Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: vcs_info: '%' in payloads not escaped
- X-seq: zsh-workers 40279
- From: Frank Terbeck <ft@xxxxxxxxxxxxxxxxxxx>
- To: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- Subject: Re: vcs_info: '%' in payloads not escaped
- Date: Fri, 06 Jan 2017 11:41:59 +0100
- Cc: zsh-workers@xxxxxxx
- In-reply-to: <20170106022128.GA6197@fujitsu.shahaf.local2> (Daniel Shahaf's message of "Fri, 6 Jan 2017 02:21:28 +0000")
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20161227150507.GA20351@fujitsu.shahaf.local2> <20170105160730.GA21106@fujitsu.shahaf.local2> <871swhqxph.fsf@ft.bewatermyfriend.org> <20170106022128.GA6197@fujitsu.shahaf.local2>
Daniel Shahaf wrote:
> Frank Terbeck wrote on Thu, Jan 05, 2017 at 17:27:06 +0100:
[...]
>> I honestly don't know. Isn't this like kind-of-predictable behavior
>> versus a — potentially — a lot of special cases? I don't think that it's
>> possible to get this right in the general case. It's in-band data that
>> is indistinguishable from data that is interpreted by something that
>> interprets zsh's prompt language.
>
> A lot of special cases, how? $git_applied_s contains a string derived
> from git, so we know that any and all percent signs in it need escaping.
The percent characters need escaping if the result is to be used in zsh
prompts. In other cases, like tmux window titles, they don't. But maybe
the hash sign (#) does, over there.
I think this is already non-trivial in zsh itself, because there may be
uses that exceed prompts. But in the general case, I don't think its
possible.
Regards, Frank
--
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
-- RFC 1925
Messages sorted by:
Reverse Date,
Date,
Thread,
Author