Syntax highlighting only appears after another key is pressed, so if the command is obtained from history, there's no syntax highlighting until another key press.
Steps to reproduce
Type in command echo "Hello World" letter by letter, and run it (and see syntax highlighting work)
Now press up arrow, to obtain the last command from history
Observe echo "Hello World" command appear, but without any syntax highlighting
Press any key, including the arrow keys (such as arrow right)
Observe the command text suddenly getting syntax highlighting
Similarly, with hist_verify option, as the expanded command is shown, there's no highlighting until a key is pressed
Expected behavior
The highlighting should appear immediately, not only after another key is pressed. I often just search the history for a command by pressing the up arrow multiple times, and I want to see the highlighting in the commands I go over, however currently, I need to press another key (like arrow right) between each result to get the highlighting to appear, which is incredibly annoying.
Arch Linux 6.1.9-arch1-1; linux-gnu | pc | x86_64 | x86_64 | x86_64 unknown
Zsh version
zsh 5.9 (x86_64-pc-linux-gnu)
Terminal emulator
alacritty
If using WSL on Windows, which version of WSL
None
Additional context
With https://github.com/zsh-users/zsh-syntax-highlighting the highlighting works properly and no additional key presses are needed. So this is clearly possible and not some kind of terminal emulator limitation or anything like that.
I should note that I am on wayland (specifically Hyprland), and that Alacritty is running natively under wayland, if that makes some difference.
Turns out the issue was that I was loading the extension before doing everything else in zshrc rather than loading it last. Moving the zgenom source line below everything else fixed the issue
Describe the bug
Syntax highlighting only appears after another key is pressed, so if the command is obtained from history, there's no syntax highlighting until another key press.
Steps to reproduce
echo "Hello World"
letter by letter, and run it (and see syntax highlighting work)echo "Hello World"
command appear, but without any syntax highlightingSimilarly, with
hist_verify
option, as the expanded command is shown, there's no highlighting until a key is pressedExpected behavior
The highlighting should appear immediately, not only after another key is pressed. I often just search the history for a command by pressing the up arrow multiple times, and I want to see the highlighting in the commands I go over, however currently, I need to press another key (like arrow right) between each result to get the highlighting to appear, which is incredibly annoying.
Screenshots and recordings
https://asciinema.org/a/kv7tJt9WRxWd2F8CjmUqhHz4d
Operating System & Version
Arch Linux 6.1.9-arch1-1; linux-gnu | pc | x86_64 | x86_64 | x86_64 unknown
Zsh version
zsh 5.9 (x86_64-pc-linux-gnu)
Terminal emulator
alacritty
If using WSL on Windows, which version of WSL
None
Additional context
With https://github.com/zsh-users/zsh-syntax-highlighting the highlighting works properly and no additional key presses are needed. So this is clearly possible and not some kind of terminal emulator limitation or anything like that.
I should note that I am on wayland (specifically Hyprland), and that Alacritty is running natively under wayland, if that makes some difference.