-
Notifications
You must be signed in to change notification settings - Fork 24
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
Make keyboard interrupts (e.g. SIGINT from Ctrl-c) work #4
Comments
Signal handling doesn't seem to be that well supported in Rust yet. chan-signal looks like the best option at the moment. Maybe add a signal received |
I don't think pressing ctrl-c will generate a signal. I think liner can just detect that |
How do other readline libs handle this? |
Created a PR for this: #42 |
At least on Unix-like systems, the shell listens for signals just like any other program. The signals are generated by the terminal/TTY driver. https://superuser.com/questions/288772/shell-sigkill-keybinding
Also helpful: http://www.linusakesson.net/programming/tty/index.php Of course, perhaps on Redox signal handling will be different. (I don't know how much this has been discussed among the Redox developers). However this does mean that, at least on non-Redox systems, we have to listen for Unix signals instead of detecting Ctrl+C (and so on) keypresses. |
No signals are raised when |
Oh, I see then. That is a bit confusing, since that means ctrl+c when editing a line is different to when some other program is running! I'll merge the PR then. |
We should probably handle |
This is done by returning an `io::Error` with `ErrorKind::Interrupted`. Issue: #4
I think handling keyboard signals correctly is a key feature for liner to have, but don't know what work is required.
The text was updated successfully, but these errors were encountered: