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

promptsubst and empty variables



I am seeing some weirdness using prompt_subst and empty variables in
RPS1 (from zsh -f):

[snip]
setopt promptsubst
RPROMPT='${foo}'
PROMPT='${bar}'
bar='%~%# '
[snap]

This results in the following cursor position:

~%_
  ^- At the underscore, that's where the cursor is. Note, the missing
     trailing space.

I've tried this with quite a few versions of zsh and I'm seeing this
with almost very version I tried:

    + it's not in 3.0, at least not in the versions I tried (not all)
    + it is in every version starting from 3.1.6 except:
        - 4.3.1 and 4.3.2
        - it's back in 4.3.3 and remains to be in the CVS HEAD
          version.


As soon as you but something into $foo in the above snippet (a simple
foo=. is enough), you get the trailing space.

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