From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10938 invoked from network); 20 Dec 1996 19:11:35 -0000 Received: from euclid.skiles.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 20 Dec 1996 19:11:35 -0000 Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA28963; Fri, 20 Dec 1996 13:54:16 -0500 (EST) Resent-Date: Fri, 20 Dec 1996 13:54:16 -0500 (EST) Message-Id: <199612201854.NAA28948@euclid.skiles.gatech.edu> Date: 20 Dec 1996 09:53 EST Sender: "Alain Caron" To: zsh-workers@math.gatech.edu From: "Alain Caron" Subject: Printing command and arguments on xterm frame. Resent-Message-ID: <"Q9v2k1.0.U47.N3kko"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/2606 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu I just upgraded to zsh-3.0.2 and there is some functionality I have been wanting from zsh for quit a while: Whenever a command is run, I would like to have the command and its arguments to be displayed on the xterm titlebar and the icon bar. Currently, I do it for some commands, like less, with the following function: function less() { xtitle "${HOST}: $0 $*" command $0 $* } where xtitle is a function that updates the xterm titlebar and icon title. For some specific cases, I do the following: xtitle "command args"; command args which gives me the wanted result. When I use several xterms on different machines, this gives me the information I need to quickly retrieve the appropriate xterm. I would like zsh to do this for me automatically... I thought about using the precmd function, but it does not work as precmd is executed before printing the prompt, therefore before the command and its arguments are known. I wonder if there already is a mechanism in the current version of zsh that would allow me to have the xterm titlebar updated for the duration of the command. I suspect the answer is no. If it is not the case, I would propose to have a function, let's call it pre-cmd-hook, that if defined, is invoked after the command is entered but before executing it. Maybe, after the zle extension proposed by Zefram, there is no need for the precmd2 function. Binding the ^J and ^M keys to a zle function that prints the command line and call accept-line would do the trick. Any comment, idea, suggestion on this? Does it seem to be a good idea to implement the pre-cmd-hook stuff or is it better to wait until the zle expension is released? If the zsh community thinks it is a good idea to implement pre-cmd-hook stuff, I will try to implement it. That will be my first attempt to modify zsh code :-) Merry Xmas to everyone. Alain Caron, email: alainc@nortel.ca phone: 514-765-7718 "Violence on television only affect children whose parents behave like TV characters" - David Byrne