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

On Fri, 12 Feb 2016 16:03:33 +0000
Peter Stephenson <[email-masked]> wrote:
> vared_prompt='The string I want the user to see'
> vared -cp ${(q)vared_prompt} user

Eyugh.  Nope.

% foo='This prompt "contains" `surprises'\''?'
% vared -cp ${(q)foo} stuff
This\ prompt\ \"contains\"\ `surprises\'\?

To automate probably better off with

vared_prompt() {
   emulate -L zsh
   unsetopt promptsubst
   vared -p $1 $2
}
vared_prompt 'The literal prompt' the_variable

pws