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

Re: vared parse error when ` in prompt string



On Fri, 12 Feb 2016 07:52:17 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 12, 10:51am, Sebastian Gniazdowski wrote:
> }
> } % vared -cp "Github user name or just \`_local': " user
> } zsh: parse error
> 
> torch% vared -cp "Github user name or just \`_local': " user
> Github user name or just `_local': foo
> torch% setopt PROMPT_SUBST
> torch% vared -cp "Github user name or just \`_local': " user
> zsh: parse error
> Github user name or just `_local': foo

I think the real point, now Bart has pointed out what the problem is, is
that you need to triple backslash the "`", or more simply use a single
quote around the lot together with a single backslash.  With
promptsubst, you need vared to see the backslash before the "`".  Or

vared_prompt='The string I want the user to see'
vared -cp ${(q)vared_prompt} user

(Refer back to http://xkcd.com/1638/ again if you've forgotten.)

pws



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