help-gnu-utils
[Top][All Lists]
Advanced

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

How to put current command in bash prompt?


From: Roy Smith
Subject: How to put current command in bash prompt?
Date: 25 Mar 2005 11:46:09 -0500

I want to have the title of my xterm windows change to indicate the
command currently being run.  I've got lots of windows with
long-running commands in them (tailing log files, status polling,
etc).  They typically are all connected to the same machine (and in
the same directory), so the standard hostname as a window title
doesn't help much.  The standard Mac OSX term application does this,
and it's very neat.

I understand the basic idea of shoving the right ANSI escape sequence
into your prompt string, but I don't see how to get the value of the
current command.  Worse, If I run something like "tail -F logfile", I
don't even get a prompt until the command is done (which is too late).

Is there any way to do what I want, short of writing a little wrapper
script which echos the right escape sequence and then executes my
commnad?




reply via email to

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