Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: chpwd() & print -Pn



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