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

Terminal output hangs every few seconds #900

Closed LucasIME closed 1 year ago

LucasIME commented 1 year ago

Hey! I've just got a new M1 Mac and was reinstalling my terminal setup and noticed something weird. My terminal output seems to hang in somewhat constant intervals. I managed to pin it down to this plugin. If I disable zsh-syntax-highlighting, everything works fine. But if it's enabled, the typing experience becomes extremely unpleasant, as it basically hangs every 1 second. It happens regardless of the terminal client I use (Terminal App or Alacritty) or if I'm inside a tmux session or not.

Here is a video of what it looks like if I just hold a key down:

https://user-images.githubusercontent.com/6787311/195362836-e2a8e454-0cd2-485f-b2f4-ea78466ac19f.mov

Not sure if this is a known issue? My previous setup on my old laptop seemed to work just fine.

Zsh version: 5.8.1 Oh my zsh version: commit b9be3a43b4da579299b4426b1ba9121f746e2555 from master zsh-syntax-highlighting version: commit 122dc464392302114556b53ec01a1390c54f739f from master

Let me know if you need any other info to track this down. Happy to help with the investigation and possible fix

CVirus commented 1 year ago

@LucasIME I'm seeing exactly the same issue here with a similar setup as yours. I'm curious if you installed zsh-syntax-highlighting using brew or from source?

CVirus commented 1 year ago

Here is an interesting find: I noticed that I have multiple tmux sessions (tmux ls) spawning even if I'm not starting them. So I suspected something might be off with tmux-continuum or tmux-resurrect and disabled them.

Now, the issue is no longer reproducible for me.

LucasIME commented 1 year ago

@CVirus I installed from source.

I noticed the issue disappear after a while. I noticed that SentinelOne scanner running on my work laptop was interfering with it somehow? I don't know if intercepting some system call or just the high cpu usage from SentinelOne. But upgrading SentinelOne made my issue with zsh-syntax-highlighting disappear.

CVirus commented 1 year ago

@LucasIME Interesting, I also have SentinelOne running on my work laptop. Do we happen to be working at the same place or is SentinelOne very common on work laptops?

LucasIME commented 1 year ago

Judging from the companies listed in our profiles, I don't think so, haha. But yeah, think SentinelOne is quite common.

For reference, upgrading it to version 22.3.2.6355 was what fixed my issue.

CVirus commented 1 year ago

Thanks for the reminder to update my company in my profile 😄

danielshahaf commented 1 year ago

Closing as no longer reproducible for either of you. Easiest issue I've ever dealt with :-)

mihaigalos commented 1 year ago

I have the same issue on my M1. I don't think I have the SentinelOne installed, at least it doesn't show up in Launchpad. Also, sometimes (but not systematically), I start typing a command like vim and just the 1st letter shows up. After about 5-10s the rest.

I'm using:

CVirus commented 1 year ago

I'm actually still seeing the same issue, unfortunately.