-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helix leaves terminal in a bad state when killed #6754
Comments
When Helix is killed we don't restore the terminal (exit raw mode, disable mouse capture, etc.). We can't do anything about this for hard kills ( |
Does using the |
@sbromberger no, @the-mikedavis I think that sounds like a good approach 👍 |
Is the solution to this not just adding SIGTERM to the application handle_signals (and to the signals passed into the application) If so, I can make that PR quickly. |
Yep, we need to add SIGTERM to the list of signals we handle: helix/helix-term/src/application.rs Line 233 in c49faf5
Then add a block in We could handle SIGINT the same way (that's what Kakoune does: https://github.com/mawww/kakoune/blob/a4918f934ceb8c36ab398c0c973174ac17fc8600/src/main.cc#L764-L765). |
Summary
After killing helix because it was stuck (I inadvertently caused a global search in my entire home directory), the editor left the terminal (iTerm 2 on macOS) in a bad state: entering normal characters work, but control keys (e.g. C-a, C-e) echo escape codes instead of moving the shell cursor.
Possibly related to #2250, however mouse movement doesn't spam the terminal for me.
Reproduction Steps
reproduction recording:

I tried this:
hx
:sh
)I expected this to happen:
I expected the terminal to work normally after exiting Helix.
Instead, this happened:
the terminal echoes control characters. Trying to reset the terminal using
reset
, or starting and exiting Helix cleanly, does not return things to normal.Helix log
~/.cache/helix/helix.log
Platform
macOS
Terminal Emulator
iTerm 2 (Build 3.4.19)
Helix Version
helix 23.03 (3cf0372)
The text was updated successfully, but these errors were encountered: