muesli / termenv

Advanced ANSI style & color support for your terminal applications
MIT License
1.76k stars 73 forks source link

fix(termenv): prevent hang in Emacs shell #152

Closed bard closed 11 months ago

bard commented 1 year ago

I noticed lefthook was hanging for several seconds when running inside Emacs shell. I tracked it down to termenv via lipgloss.

Edit: this also happens in Magit and any other Emacs subprocess.

This PR fixes the delay by adding a check for TERM=dumb, which is the default in Emacs shell, as it's already done for TERM=tmux and TERM=screen.

Before:

Screencast from 2023-09-15 19-24-17.webm

After:

Screencast from 2023-09-15 19-23-34.webm

mrexox commented 1 year ago

+1 for this fix!

sanmai-NL commented 1 year ago

@muesli Do you have a planning for looking at this PR?

muesli commented 1 year ago

Yep, will merge this! Thank you!