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

Re: Preexec & Printf



----- Original Message -----
From: Geoff Wing <mason@xxxxxxxxxxxxxxx>
Date: Thursday, April 25, 2002 8:22 pm
Subject: Re: Preexec & Printf

> Joshua Symons <vmcore@xxxxxxxxx> typed:
> : I have a pretty generic problem, but I can't seem to make my way 
> around: it. Here is an example of what is happening:
> 
> : [(ichirou:151:pts/15)~ %] which preexec
> : preexec () {
> :         print -Pn "\e]0;%m:%l   -   $* \a"
> :}
> : [(ichirou:152:pts/15)~ %] printf '^[[32;40mwith quotes\n'
> 
> : For echo, print, and printf, my '' is getting passed (straight 
> quote): into preexec and erroring back out into my shell. I can't 
> seem to get
> : around the quotes that are passed into preexec. This doesn't 
> happen in
> : dtterm for some reason, not sure why. 
> : Any help that could be given would be nice.
> 
> Your problem is different to what you think.  You're using xterm and
> you're expecting it to not print the set of characters sent through 
> thepreexec without consideration of what characters are permissible.
> 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
how-to.
Is there a better way to terminate the title?

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

OSC ?

> 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.
> 
> Regards,
> -- 
> Geoff Wing : <gcw@xxxxxxxxx>
> Rxvt Stuff : <gcw@xxxxxxxx>
> Zsh Stuff  : <gcw@xxxxxxx>
> 



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