-
Notifications
You must be signed in to change notification settings - Fork 178
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
Abort readline? #780
Comments
We need to check if Lines 667 to 674 in 99aeb43
If not, maybe try to close StdIn or send a signal (currently, rustyline only listen to SIGWINCH ) ?
|
Thanks for the suggestions. From what I've found online, I don't think there is a way for me to close the main |
or use an alternative like https://docs.rs/linefeed/0.5.4/linefeed/reader/struct.Reader.html#method.read_line_step |
listening for SIGINT would be it right ? |
I'm new to Rust and am not sure if this is the right way to handle things, but I am using rustyline to create a program that accepts user input to send over TCP.
I've set up a separate task to run in the background to poll if the TCP socket is open, and, if not, it will exit the program. The problem is that I'm not sure how to get rustyline to stop waiting for input when I want to shutdown, so I use
exit(1)
, but this does not let rustyline restore the terminal. Should I just manually disable raw mode before exiting, or is there an approved way to abort a readline so I can gracefully shutdown?Thanks for the great crate, too.
The text was updated successfully, but these errors were encountered: