zsh-users
 help / color / mirror / code / Atom feed
* Getting xterm title bar to display last command...
@ 1997-05-21 19:38 Sam Ockman
  1997-05-22  3:29 ` Zoltan Hidvegi
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ockman @ 1997-05-21 19:38 UTC (permalink / raw)
  To: zsh-users

Okay, so I have the neat function from the zsh web site to get my xterm to
display the current directory....Anyone know how to use that basic idea to
get my xterm to display the last thing entered at the command line
instead?

Thanks,
Sam


-- 
VA Research Linux Workstations        |  The World's Best Linux Workstations
                                      |	          Featuring RedHat
http://www.varesearch.com             |  Now offering VarStation II Systems
Sam Ockman - (415)934-3666, ext. 133  |     Based on the Intel Pentium II


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

* Re: Getting xterm title bar to display last command...
  1997-05-21 19:38 Getting xterm title bar to display last command Sam Ockman
@ 1997-05-22  3:29 ` Zoltan Hidvegi
  1997-05-22 15:47   ` Zefram
  1997-05-22 17:14   ` Greg Badros
  0 siblings, 2 replies; 4+ messages in thread
From: Zoltan Hidvegi @ 1997-05-22  3:29 UTC (permalink / raw)
  To: Sam Ockman; +Cc: zsh-users

> Okay, so I have the neat function from the zsh web site to get my xterm to
> display the current directory....Anyone know how to use that basic idea to
> get my xterm to display the last thing entered at the command line
> instead?

In zsh-3.1.2 (coming soon), thanks to Zefram, you can do:

zle -N my-accept-line
my-accept-line () { print -nr -- "^[]2;$BUFFER^G"; zle accept-line; }
bindkey '^M' my-accept-line

Note that you have to type real ESC and CTRL-G instead of ^[ and ^G.  In
zsh-3.0, and probably in zsh-3.1.1 too, there is no way to do that.

Zoltan


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

* Re: Getting xterm title bar to display last command...
  1997-05-22  3:29 ` Zoltan Hidvegi
@ 1997-05-22 15:47   ` Zefram
  1997-05-22 17:14   ` Greg Badros
  1 sibling, 0 replies; 4+ messages in thread
From: Zefram @ 1997-05-22 15:47 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: ockman, zsh-users

Zoltan Hidvegi wrote:
>zle -N my-accept-line
>my-accept-line () { print -nr -- "^[]2;$BUFFER^G"; zle accept-line; }
>bindkey '^M' my-accept-line

A better way is:

xterm-accept-line () { print -nr -- "^[]2;$BUFFER^G"; zle .accept-line; }
zle -N accept-line xterm-accept-line

which replaces all instances of accept-line, rather than just '^M'.
It can be undone by

zle -A .accept-line accept-line

-zefram


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

* Re: Getting xterm title bar to display last command...
  1997-05-22  3:29 ` Zoltan Hidvegi
  1997-05-22 15:47   ` Zefram
@ 1997-05-22 17:14   ` Greg Badros
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Badros @ 1997-05-22 17:14 UTC (permalink / raw)
  To: Zoltan Hidvegi; +Cc: Sam Ockman, zsh-users

Zoltan Hidvegi <hzoli@ny.frontiercomm.net> writes:

> > Okay, so I have the neat function from the zsh web site to get my xterm to
> > display the current directory....Anyone know how to use that basic idea to
> > get my xterm to display the last thing entered at the command line
> > instead?
> 
> In zsh-3.1.2 (coming soon), thanks to Zefram, you can do:
> 
> zle -N my-accept-line
> my-accept-line () { print -nr -- "^[]2;$BUFFER^G"; zle accept-line; }
> bindkey '^M' my-accept-line
> 
> Note that you have to type real ESC and CTRL-G instead of ^[ and ^G.  In
> zsh-3.0, and probably in zsh-3.1.1 too, there is no way to do that.
> 
> Zoltan

My colorized listing and postprompt patch does this for Zsh-3.0.2.  You
set PPTMOUT to the number of seconds to wait before displaying the
string, and set POSTPROMPT to the string to display (including the
escape characters).

Note that this has the advantage that only commands that are running for
a certain length get displayed.  It has the disadvantage of the
possibility (very very rare when you use an xterm control sequence) of
mixing output with the running program. (not a problem if running
program sends output to a file).

See the patches on my web page, ../gjb/patches

Greg J. Badros
gjb@cs.washington.edu
Seattle, WA  USA
http://www.cs.washington.edu/homes/gjb


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

end of thread, other threads:[~1997-05-22 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-05-21 19:38 Getting xterm title bar to display last command Sam Ockman
1997-05-22  3:29 ` Zoltan Hidvegi
1997-05-22 15:47   ` Zefram
1997-05-22 17:14   ` Greg Badros

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