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:


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).


Greg J. Badros
Seattle, WA  USA

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