rschmitt / heatseeker

A high-performance Selecta clone, written in Rust.
MIT License
214 stars 10 forks source link

Exiting via ^C changes terminal settings #26

Closed cdlm closed 5 years ago

cdlm commented 7 years ago

After cancelling hs using control-C, the terminal is left in a different state. The return key results in ^M instead of newlines, as described here.

This can be confirmed by comparing the output of stty -a | grep icrnl before and after running hs and pressing ^C. Pressing ^G instead of ^C behaves correctly.

rschmitt commented 7 years ago

That's a good point. I've personally always used ^G, but there's no reason that I couldn't trap ^C. I think I would also need to essentially reimplement https://github.com/garybernhardt/selecta/commit/7a70fce0fab8f74212fcfce9642eacc40c3321ed.