Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Zsh "POSTPROMPT" Feature
- X-seq: zsh-workers 1179
- From: Andrew J Cosgriff <ajc@xxxxxxxxxxxx>
- To: "Greg J. Badros" <gjb@xxxxxxxxxxxxxxx>
- Subject: Re: Zsh "POSTPROMPT" Feature
- Date: Sun, 26 May 1996 09:01:21 +1000
- >received: from ufo.unico.com.au (ufo [192.168.21.21]) by padre.dev.unico.com.au (8.7.5/8.7.3) with SMTP id JAA21598; Sun, 26 May 1996 09:01:47 +1000 (EST)
- Cc: zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: gjb's message of Sat, 25 May 1996 13:20:22 -0400. <Pine.SOL.3.93.960525130209.22483A-200000@xxxxxxxxxxxxxxx>
- Sender: ajc@xxxxxxxxxxxxxxxxxxxx
"Greg J. Badros" <gjb@xxxxxxxxxxxxxxx> wrote:
> One feature that I've not seen talked about but that would be useful
>(mostly in an X environment) is the addition of a POSTPROMPT variable. I
>have patches for zsh-2.5.03 that implement this, and then my .zshrc sets
>my POSTPROMPT to
>{%^[]0;%H^G%}
>(Where ^[ is ESC, ^G is Ctrl-G-- the xterm sequence for setting the title
>and icon). [The %H is a change to print the last/current history item].
Well, if you just want to keep track of your current directory in your title bar, there's no need to patch zsh...For a start it's a little more efficient to only change your xterm title when you need to - ie. when you change directory - this can be done with the "chpwd" function, like so :
chpwd () {
local dir=`print -D ${PWD}`
local title=${LOGNAME}@$(uname -n):$dir
print -n -D -P "\033]2;${title}\007"
}
Enjoy,
Andrew.
--
- Andrew J Cosgriff - ajc@xxxxxxxxxxxxxxxxx - Mobile : +61-14-856-122
SysAdmin / Support Dude, UNICO Computer Systems PGP & MIME ok and preferred
"Your future is encoded in Pi."
Messages sorted by:
Reverse Date,
Date,
Thread,
Author