[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Dave Rutherford
Subject: A case for PROMPT_COMMAND
Date: Thu, 4 Oct 2001 16:38:08 -0400 (EDT)

On Fri, 10 Aug 2001, Paul Jarc wrote:

> BTW, a while ago, someone else asked for something like
> $PROMPT_COMMAND which would be run after the user entered a command,
> and before executing the command.  (He didn't say what he wanted to
> use it for.)  This feature would also satisfy that request.

Actually he did explain it, just not well enough.  It's tricky
to explain without being able to use color, here in this ASCII channel.
But it's something I'd like, and would use, so let me try.

In a color xterm, with PS1 and PS2 I can arrange for the prompt to
be one color, and what I type another color.  But without something
like PROMPT_COMMAND, the output from whatever program I run is in
the same color as my typing*.  If I could have it a third color
to visually distinguish between input and output, the effect could
be quite pleasing.

    $ date
    Thu Oct  4 16:26:39 EDT 2001

Pretend the dollar signs are cyan, 'date' is green, and the
date output is yellow.  This effect cannot be done with
bash as it now stands ... as far as I know.

* - Excluding commands that do their own thing, like ls --color.


I'm antisesquipedalial -- and YOU should be, TOO!

Visit http://evilpettingzoo.com/dave/key.html for GnuPG 1.0 public key.
Key Fingerprint: E79F 7344 84A1 A0F2 653B  F700 9CDF B8D4 DA73 2AF7

reply via email to

[Prev in Thread] Current Thread [Next in Thread]