Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: chpwd() & print -Pn
- X-seq: zsh-users 10006
- From: Konstantin Sobolev <k_o_s@xxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: chpwd() & print -Pn
- Date: Wed, 8 Mar 2006 23:50:50 +0300
- In-reply-to: <EXCHANGE03BNvHIGqws00014743@xxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <200603082010.08251.k_o_s@xxxxxxx> <EXCHANGE03BNvHIGqws00014743@xxxxxxxxxxxxxxxxxx>
On Wednesday 08 March 2006 20:39, Peter Stephenson wrote:
> > chpwd () { print -Pn '^[]2;%~^G' }
> >
> > instead it simply prints this stuff to the console:
> >
> > kos@kos /tmp $ cd /tmp
> > ^[]2;/tmp^G%
> >
> > what could be causing it?
>
> The syntax you're showing only works if the ^[ is a real escape
> character and ^G a real control-G: "print -P" doesn't handle the ^ in
> the way that bindkey does. Maybe you copied this in some way as to turn
> it into the characters you've shown? (The terminal will represent
> the characters in the way you've shown on output the same in either
> case.)
No, I've copied the function from the .zshrc file. ^[ is really there.
>
> It's safer to use:
>
> chpwd() { print -Pn '\e]2;%~\a' }
>
> However, this hasn't actually changed since 4.2; I tried 4.0.7 and 4.2.2
> and they behaved the same way.
strangely enough, my sequence really works, xterm title is changed. But this
crap is printed after each 'cd'.
However, your variant works flawlessly, I'll use it :)
Thanks.
--
/KoS
* Dancing with Wolves, Sleeping with beavers
Messages sorted by:
Reverse Date,
Date,
Thread,
Author