Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Updating the Xterm title with every execution?



Ryan Tennant <rtennant@xxxxxxxxxx> writes:

> Hello.  I am trying to update the Xterm title every time I execute an
> application, script, etc.  To do this, it would seem logical that I have to
> process the commands I enter at the command line before executing them.  Zsh
> seems to offer some preprocessing functionality, but not so much that I can
> ask it to preprocess command line information and then execute an arbitrary
> command.

You should take a look at my patch to zsh-3.0.5:

http://www.cs.washington.edu/homes/gjb/patches/zsh-3.0.5-color-postprompt.README
http://www.cs.washington.edu/homes/gjb/patches/zsh-3.0.5-color-postprompt.patch

it adds a POSTPROMPT that lets zsh output an arbitrary prompt-like
expression *after* reading a command (optionally delaying some
configurable number of seconds).  I use this with XTerm escape sequences 
to do exactly as you suggest (and in fact this was the motivating
problem-- I just generalized it in case anyone else can think of other
cool things to use it for).  My Xterm titles reflect the name of the
last command that ran for more than $PPTMOUT (=5) seconds.

The patch also adds colorization (a la GNU color-ls) to the completion
lists.  (Also a run-time option).

Enjoy!

Greg J. Badros
gjb@xxxxxxxxxxxxxxxxx
Seattle, WA  USA
http://www.cs.washington.edu/homes/gjb



Messages sorted by: Reverse Date, Date, Thread, Author