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
20.26k stars 1.33k forks source link

zsh command line freezes when trying to edit specific command #791

Open cavetroglodyt opened 3 years ago

cavetroglodyt commented 3 years ago

Hello,

Testing commands for a script I want to write, I executed the following:

var=$(curl https://iptv-org.github.io/iptv/channels.json | jq '.') && sel=$(echo $var | jq '.[].name' | dmenu) && echo $var | jq ".[] | select(.name == $sel)" | jq .url

The command does what it is supposed to do, no problem here. I then wanted to edit the line, so I brought it back with the arrow key, navigated right behind the second "&&" and tried to enter more text, but nothing happens. The command line freezes and doesn't respond to any key input other than ctrl-c. With a little bit more testing I found out, that this only seems to happen around the "echo" commands. An attempt to input text there results in the shell freezing. While frozen zsh then proceeds to progressively claim all open memory.

All of this does not happen in the absence of zsh-syntax-highlighting

I tested the issue with zsh 5.8, the present version of zsh-syntax-highlighting and a .zshrc that sources nothing but the plugin.

As I'm quite new here: Please let me know what additional information you need.

Cheers

phy1729 commented 3 years ago

What version of z-sy-h in particular are you using (cf. $ZSH_HIGHLIGHT_VERSION and $ZSH_HIGHLIGHT_REVISION). This sounds similar to #775 for which #776 was recently merged. If the issue persists on current master, could you try to find a minimal reproducer starting from zsh -f (so any relevant functions and aliases are explicitly noted)?

cavetroglodyt commented 3 years ago

Here are the versions

ZSH_HIGHLIGHT_VERSION 0.8.0-alpha2-dev

ZSH_HIGHLIGHT_REVISION 55575ZSH_HIGHLIGHT_REVISION

When invoking zsh -f and sourcing the plugin the issue immediaterly appears. My /etc/zsh/zshenv sets $XDG_CONFIG_HOME and $ZDOTDIR, if that matters.

cavetroglodyt commented 3 years ago

Reading a bit about debugging in zsh I came across the zsh/zprof module. If this is useless please ignore the rest of this comment.

With zsh -f, z-sy-h loaded and the module activated I reproduced the above mentioned steps and waited a couple of seconds. The output of zprof can be found here.