zsh-users
 help / color / mirror / code / Atom feed
* show command in XTERM titlebar like function chpwd()
@ 1997-07-09  7:43 heiko_elger
  1997-07-09  8:32 ` Andrew Main
  0 siblings, 1 reply; 2+ messages in thread
From: heiko_elger @ 1997-07-09  7:43 UTC (permalink / raw)
  To: zsh-users

     Hello, 
     is it possible to use own functions (like run-help) with the bindkey 
     command?

     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.

     I know the the function precmd(), but it is executed after the command 
     was executed and before writing th prompt. To update my XTERM titlebar 
     I must have a function which is called before executing the command: 
     with teh precmd() I reset my XTERM titlebar after executing the 
     command.

     Does anyone can help me.

     Heiko


     Email: heiko_elger@arburg.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: show command in XTERM titlebar like function chpwd()
  1997-07-09  7:43 show command in XTERM titlebar like function chpwd() heiko_elger
@ 1997-07-09  8:32 ` Andrew Main
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Main @ 1997-07-09  8:32 UTC (permalink / raw)
  To: heiko_elger; +Cc: zsh-users

heiko_elger@arburg.com 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-07-09  8:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-07-09  7:43 show command in XTERM titlebar like function chpwd() heiko_elger
1997-07-09  8:32 ` Andrew Main

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).