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

Updating the Xterm title with every execution?

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

A script to display what I'm interested in doing is below.  

script name: hi
echo '\033]; '$*'\007'				# Displays command in xterm
title after script name (i.e hi ls -la, would display ls -la)
trap "trap '' 2"  2					
$*						# Executes commands I enter
after the script name
trap ""  2
echo '\033]; '${HOSTNAME}: IDLE'\007'		# Displays idle xterm title

i want to do line 1 after i hit enter before execution of $*.  I want to
reset the title bar in the event that I hit ctrl-c (traps).  I want to do
line 6 after execution of the commands.

obviously the functionality of this script is limited in the fact that it
doesnt parse beyond "|"s or other delimeters.

essentially, i'm looking for someone more gifted than myself to aid in my


ryan tennant

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