Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Using "fc -ap" in zle-line-init confuses command recall
- X-seq: zsh-workers 52278
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Using "fc -ap" in zle-line-init confuses command recall
- Date: Mon, 6 Nov 2023 15:36:17 -0800
- Archived-at: <https://zsh.org/workers/52278>
- List-id: <zsh-workers.zsh.org>
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