-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
x/term: Cannot differentiate a CTRL+C from CTRL+D #62385
Comments
In our particular case, we basically want Ctrl+C to be equivalent to Ctrl+U (yes, we could use Ctrl+U, but muscle memory and all that). I can see a few options here, and I'm happy to contribute a CL on gerrit if there's some guidance on which approach would be most appropriate:
|
Hi, I met with the same problem, but in my case I need to ignore Ctrl+C. |
I would vote for option 3 too, have you got a working PR? |
No |
my vote for option 3 it provide more flexibility, and let programmers decide how they want to react in their particular context. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I'd like to know if a user input CTRL+C (along with the ability to react to it; i.e., it advances the "line" buffer and gives me a callback or handler) so that I can emulate the typical shell behavior or clearing the input when a user hits CTRL+C while providing input.
What did you see instead?
I get io.EOF for CTRL+C. If I ignore it and call ReadLine again, I am repeatedly given the same error because
t.remainder
is not advanced.The text was updated successfully, but these errors were encountered: