Open AndydeCleyre opened 2 years ago
Hello, @AndydeCleyre! Thanks for the report. I have seen something like that myself on occasion, but I have never been able to pinpoint the exact conditions. I'll give your configuration a try.
Your configuration is great -- I've gotten the problem to occur a couple of times already. I'll get to work on this.
I only seem to have this problem if I use zdharma-continuum/fast-syntax-highlighting
(it doesn't happen with zsh-users/zsh-syntax-highlighting
). In fact, I run into it reliably with a mere
source /path/to/agkozak-zsh-prompt.plugin.zsh
source /path/to/fast-syntax-highlighting.plugin.zsh
in my .zshrc
, and sleep 1
, followed by fast typing, at the command line -- as you pointed out.
Reversing the order in which I load the two plugins seems to help slightly; if any garbling occurs, it is corrected when I switch to vi
command mode. Interesting.
I'll keep playing around with this.
Thanks! The FSH interaction was something I only considered while writing this issue, and your corroboration spurred me to try a bisect on FSH. Over here, it looks like the problem started with:
commit 08a4ce96953764f03d617f1c52e9a2a3ad6f58c2
Author: Sebastian Gniazdowski <sgniazdowski@gmail.com>
Date: Sun Feb 23 01:01:14 2020 +0100
plugin.zsh: Use emulate instead of bare setopt
diff --git a/fast-syntax-highlighting.plugin.zsh b/fast-syntax-highlighting.plugin.zsh
index f11177d..4b88d3f 100644
--- a/fast-syntax-highlighting.plugin.zsh
+++ b/fast-syntax-highlighting.plugin.zsh
@@ -72,7 +72,9 @@ _zsh_highlight()
return $ret
fi
- setopt localoptions warncreateglobal noksharrays noshwordsplit extendedglob typesetsilent nokshglob
+ emulate -LR zsh
+ setopt extendedglob warncreateglobal typesetsilent noshortloops
+
local REPLY # don't leak $REPLY into global scope
local -a reply
So I checked output of setopt
just after that sets the options, from before and after:
--- BEFORE.txt 2022-04-04 22:25:12.080597430 -0400
+++ AFTER.txt 2022-04-04 22:26:08.085803758 -0400
@@ -1,22 +1,13 @@
-alwaystoend
-autopushd
-nocaseglob
-completeinword
extendedglob
-noflowcontrol
-globdots
-histignorealldups
-histignorespace
-histverify
interactive
-interactivecomments
localoptions
+localpatterns
+localtraps
login
monitor
-promptsubst
-pushdignoredups
-sharehistory
shinstdin
+noshortloops
typesetsilent
warncreateglobal
zle
I'm currently testing with promptsubst
added to the list. So far, so good.
EDIT: Nope, reproduced.
I haven't seen this since locally reverting https://github.com/zdharma-continuum/fast-syntax-highlighting/commit/08a4ce96953764f03d617f1c52e9a2a3ad6f58c2. I'll open an issue there linked to this one.
Fascinating. Thanks for staying on top of this issue, @AndydeCleyre.
Hello!
Sometimes I begin typing the next command while the previous one is running, and this works, even with this bug. But the prompt display gets temporarily mangled in this event.
This is hard for me to reliably reproduce with a clean setup, and so I'm sorry for such a messy report.
I think that to reproduce we need:
Here's my prompt-related code:
When run within a tmux session, run
sleep 1
, and then keep typing while that finishes: