chzyer / readline

Readline is a pure go(golang) implementation for GNU-Readline kind library
MIT License
2.06k stars 273 forks source link

Option to restore terminal when interrupted #195

Closed nicollet closed 2 years ago

nicollet commented 2 years ago

Add option ExitRawOnInterrupt (default off). When turned on, change disposition of SIGTERM and SIGINT, so that we restore the terminal mode before exiting. That way, prevents users from having to reset the terminal themselves most of the time.

chzyer commented 2 years ago

Hi, @nicollet The current version has a bug that does not restore the terminal when receiving a SIGTERM/SIGINT.
But I think adding an option ExitRawOnInterrupt to the configuration is a bad idea because the configuration is changeable.
I have an implementation for fixing it in #200. You can check if that is what you want. If not, you can reopen it.