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 16:03:33 +0000
Peter Stephenson <p.stephenson@xxxxxxxxxxx> 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



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