Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: show command in XTERM titlebar like function chpwd()
- X-seq: zsh-users 938
- From: Andrew Main <zefram@xxxxxxxxx>
- To: heiko_elger@xxxxxxxxxx
- Subject: Re: show command in XTERM titlebar like function chpwd()
- Date: Wed, 9 Jul 1997 09:32:54 +0100 (BST)
- Cc: zsh-users@xxxxxxxxxxxxxxx
- In-reply-to: <00000449.@xxxxxxxxxx> from "heiko_elger@xxxxxxxxxx" at Jul 9, 97 08:43:37 am
heiko_elger@xxxxxxxxxx wrote:
> is it possible to use own functions (like run-help) with the bindkey
> command?
It is now (3.1.2).
> I want to update my XTERM title bar every time I'll press then ENTER
> key. I want to have the command name which is executing in the title
> bar.
The best way to do this is not to bind a new function to ENTER, but to
redefine accept-line:
accept-line () {
local cmd=${BUFFER%%" "*}
[[ -n "$cmd" && $TERM == xterm* ]] && print -nR "executing: $cmd"
zle .accept-line
}
zle -N accept-line
Replace the print argument with whatever sequence is required for the xterm
titlebar.
-zefram
Messages sorted by:
Reverse Date,
Date,
Thread,
Author