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

Re: Preexec & Printf

Joshua Symons <vmcore@xxxxxxxxx> typed:
:----- Original Message -----
:From: Geoff Wing <mason@xxxxxxxxxxxxxxx>
:Date: Thursday, April 25, 2002 8:22 pm
:Subject: Re: Preexec & Printf
:> Obviously you'll have problems if you try to send a BEL (\a) via the
:I was actually using the example provided in the xterm title setting
:Is there a better way to terminate the title?

No, I mean, if you try to send a line like:

% echo "hi\athere"

then the BEL will terminate the string sent via the preexec and ``there''
won't end up in the title but will be sent normally onto the display.

:> normal line because it'll terminate the title-set OSC in the print 
:> in the
:OSC ?

OSC=Operating System Command, a terminal (emulator) specific char sequence.
In this case, the  ESC ] 0 . . . ST  sequence to set the title.

:> preexec().  You'll also have problems with xterm with other non-
:> printablecharacters, e.g. ESC, CR, LF - xterm will also use those 
:> as terminators
:> since they're non-valid.  You'll need to do some more character
:> sanitisation first on the string sent via the preexec() print.

AFAIK, you'll still have problems even using the ${(QV)1} sequence because
it gets the line in a raw form - but the print parses it. e.g.

% echo "hi\nthere"

will fail because the V operator won't be effective since \n are just two
characters but the print command in the preexec converts it to one
special non-printable character which terminates the title-set OSC.

Geoff Wing : <gcw@xxxxxxxxx>
Rxvt Stuff : <gcw@xxxxxxxx>
Zsh Stuff  : <gcw@xxxxxxx>

Messages sorted by: Reverse Date, Date, Thread, Author