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

Re: vcs_info: '%' in payloads not escaped



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