Subject: Re: vared parse error when ` in prompt string
From: Peter Stephenson <[email-masked]>
To: Bart Schaefer <[email-masked]>, Zsh hackers list <[email-masked]>
Date: Fri, 12 Feb 2016 16:03:33 +0000
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Fri, 12 Feb 2016 07:52:17 -0800
Bart Schaefer <[email-masked]> 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