zsh-users
 help / color / mirror / code / Atom feed
From: Konstantin Sobolev <k_o_s@mail.ru>
To: zsh-users@sunsite.dk
Subject: Re: chpwd() & print -Pn
Date: Wed, 8 Mar 2006 23:50:50 +0300	[thread overview]
Message-ID: <200603082350.50376.k_o_s@mail.ru> (raw)
In-Reply-To: <EXCHANGE03BNvHIGqws00014743@exchange03.csr.com>

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			      


      reply	other threads:[~2006-03-08 20:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-08 17:10 Konstantin Sobolev
2006-03-08 17:39 ` Peter Stephenson
2006-03-08 20:50   ` Konstantin Sobolev [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200603082350.50376.k_o_s@mail.ru \
    --to=k_o_s@mail.ru \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).