zsh-workers
 help / color / mirror / code / Atom feed
* Using "fc -ap" in zle-line-init confuses command recall
@ 2023-11-06 23:36 Bart Schaefer
  0 siblings, 0 replies; only message in thread
From: Bart Schaefer @ 2023-11-06 23:36 UTC (permalink / raw)
  To: Zsh hackers list

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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-06 23:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06 23:36 Using "fc -ap" in zle-line-init confuses command recall Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).