Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: /usr/bin/printf
- X-seq: zsh-users 13837
- From: Matthew Flaschen <matthew.flaschen@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: /usr/bin/printf
- Date: Thu, 12 Feb 2009 23:13:54 -0500
- In-reply-to: <dbfc82860902121940x7270f12dt13f10d706c9e65fb@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <4994CFCF.2090408@xxxxxxxxxx> <237967ef0902121751k37dd810co312238682d9b60f0@xxxxxxxxxxxxxx> <4994E32E.2050508@xxxxxxxxxx> <090212192523.ZM11726@xxxxxxxxxxxxxxxxxxxxxx> <dbfc82860902121940x7270f12dt13f10d706c9e65fb@xxxxxxxxxxxxxx>
Nikolai Weibull wrote:
> On Fri, Feb 13, 2009 at 04:25, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
>> The problem is that $1 is first expanded by the command parser and then
>> passed to "print".
>
>> The (q) tells zsh to insert a backslash before any special characters
>> that appear in the value of $1, including the backslash in "\n". Then
>> "print" strips the extra backslashes off again and the final output is
>> the original string.
>
> Couldn't one use the -r switch to print as well?
Well, it can't be used for the whole thing, because some escapes are
supposed to be used. I tested, and:
preexec () { print -Pn "\e]0;%n@%m: "; print -rn "$1"; print -n "\a" }
does works I'm not really sure why there's a \a at the end anyway. I
presume this doesn't mean system bell here.
Matt Flaschen
Messages sorted by:
Reverse Date,
Date,
Thread,
Author