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

Using "fc -ap" in zle-line-init confuses command recall



Easily reproduced:

zsh -f
% zle-line-init() { fc -ap /dev/null }
% zle -N zle-line-init
% echo This will vanish
This will vanish
(press up-arrow)
% zle -N zle-line-init
(press down-arrow)
% echo Try again
Try again
(press up-arrow)
% echo This will vanish

The command isn't actually lost, it's just not possible to recall it
until another command has been run.  Everything is "delayed" by one
entry.  Use of /dev/null is not significant, any file argument whether
empty or not will work.

I believe this also confuses the PS2 parser state (cmdstack?) but
haven't come up with a simple way to reproduce that.




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