zsh-users / zsh-syntax-highlighting

Fish shell like syntax highlighting for Zsh.
github.com/zsh-users/zsh-syntax-highlighting
BSD 3-Clause "New" or "Revised" License
19.55k stars 1.32k forks source link

Weird issue on Ubuntu over SSH #873

Closed NotLazy closed 2 years ago

NotLazy commented 2 years ago

I installed ZSH 5.8 and 3 plugins

zsh-syntax-highlighting zsh-autosuggestions powerlevel10k

immediately after installing them and running zsh, I was unable to type anything into my terminal/ssh session anymore.

Disabling (only) zsh-syntax-highlighting allows me to type as normal and as expected into my terminal/ssh session.

After some fiddling around, I discovered I can press Ctrl+C to make my last pressed key be recognized.

so, if I type "e" and hit ctrl+c "e" will show up in my prompt, then "x" and ctrl+c, "x" will show up, etc. Then, when I get to "exi" and type "t" it fills in no problem, and I can even hit return to execute the exit command.

It appears to be an issue when the currently typed command doesn't exist, that the terminal hangs and doesn't accept input until I ctrl+c whatever is blocking the terminal.

my .version file has 0.8.0-alpha2-dev

danielshahaf commented 2 years ago

Disabling (only) zsh-syntax-highlighting allows me to type as normal and as expected into my terminal/ssh session.

That doesn't mean z-sy-h is the culprit. The problem might be an interaction of plugins. We need a minimal reproduction recipe that starts with a zsh -f and uses as few external dependencies as possible.

so, if I type "e" and hit ctrl+c "e" will show up in my prompt, then "x" and ctrl+c, "x" will show up, etc. Then, when I get to "exi" and type "t" it fills in no problem, and I can even hit return to execute the exit command.

What's the color of the word "exit"?

It appears to be an issue when the currently typed command doesn't exist, that the terminal hangs and doesn't accept input until I ctrl+c whatever is blocking the terminal.

OK. Can you please drop set -x to the top of your .zshenv file, start zsh with z-sy-h enabled, then reproduce the problem again (simply typing a comma at the prompt should be enough, unless you have an alias/function/command literally called ,), and post here the last few lines?

NotLazy commented 2 years ago

Oddly enough, I cant reproduce the issue now, even tho I was able to reproduce it previously by enabling/disabling z-sy-h, and having z-sy-h be the only plugin, enabling/disabling still caused the issue while enabled.

That being said, I can't answer all your questions, but I can answer this...

What's the color of the word "exit"?

The color was red until I got to the point of "exit" then it became green. The prompt was previously only freezing when the prompt and or next prompt was red.

danielshahaf commented 2 years ago

The color was red until I got to the point of "exit" then it became green. The prompt was previously only freezing when the prompt and or next prompt was red.

Thanks, that's useful.

Oddly enough, I cant reproduce the issue now, even tho I was able to reproduce it previously by enabling/disabling z-sy-h, and having z-sy-h be the only plugin, enabling/disabling still caused the issue while enabled.

Well, closing as unreproducible, then. Don't hesitate to reopen if this reproduces (even if only intermittently).

danielshahaf commented 1 year ago

Disabling (only) zsh-syntax-highlighting allows me to type as normal and as expected into my terminal/ssh session.

This doesn't rule out the possibility of plugin interaction being the cause. Can you try 'zsh -f' + manually sourcing zsh-syntax-highlighting.zsh?

After some fiddling around, I discovered I can press Ctrl+C to make my last pressed key be recognized.

so, if I type "e" and hit ctrl+c "e" will show up in my prompt, then "x" and ctrl+c, "x" will show up, etc. Then, when I get to "exi" and type "t" it fills in no problem, and I can even hit return to execute the exit command.

So, presumably when you type, say, 'lsmod', typing the 's' is fast because ls(1) exists? And if you'd created an alias or function named 'm', typing the 'm' would then be fast too?

It appears to be an issue when the currently typed command doesn't exist, that the terminal hangs and doesn't accept input until I ctrl+c whatever is blocking the terminal.

Not clear whether it's an infinite loop or just a long delay. Can you try:

my .version file has 0.8.0-alpha2-dev

I assume you're running latest master, then? See $ZSH_HIGHLIGHT_REVISION (and git rev-parse HEAD).