zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: zsh-users@sunsite.dk
Subject: Re: chpwd() & print -Pn
Date: Wed, 08 Mar 2006 17:39:53 +0000	[thread overview]
Message-ID: <EXCHANGE03BNvHIGqws00014743@exchange03.csr.com> (raw)
In-Reply-To: <200603082010.08251.k_o_s@mail.ru>

Konstantin Sobolev wrote:
> Hi
> 
> sorry for probably a stupid question.. after upgrading zsh from 4.2.x to 4.3.
> 2 
> my chpwd function meant to update xterm's title stopped working:
> 
> 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.)

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.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php


  reply	other threads:[~2006-03-08 17:45 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 [this message]
2006-03-08 20:50   ` Konstantin Sobolev

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=EXCHANGE03BNvHIGqws00014743@exchange03.csr.com \
    --to=pws@csr.com \
    --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).