Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Preexec & Printf
- X-seq: zsh-users 4873
- From: Geoff Wing <mason@xxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Preexec & Printf
- Date: Fri, 26 Apr 2002 01:22:34 +0000 (UTC)
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Organization: PrimeNet Computer Consultants
- References: <2565c1e9b2.1e9b22565c@xxxxxxxxx>
- Reply-to: mason@xxxxxxxxxxxxxxx
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 the
preexec without consideration of what characters are permissible.
Obviously you'll have problems if you try to send a BEL (\a) via the
normal line because it'll terminate the title-set OSC in the print in the
preexec(). You'll also have problems with xterm with other non-printable
characters, 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