-
Notifications
You must be signed in to change notification settings - Fork 218
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
Ctrl-C doesn't work in Windows when in raw mode #822
Comments
Not sure if this is the right way, but the way I'm handling this for now is:
No idea if this is the wrong way but it seems to be working for now, until I know if there's a better solution. |
There is most probably a bug in JLine. The I'll try to investigate a fix. |
Thanks for the explanation! Since I have a workaround, it's not urgent on my end. However, if you are able to get a fix in, I'll update my dependency and remove the workaround. |
When using jline3 on Unix, I can use ctrl-C to exit my application. But I noticed it wasn't working on Windows, so I tried to dig in a bit.
I'm slightly worried this is report is user error, that maybe I'm doing something wrong without realizing it, but I'll file this repro case just in case.
Repro steps
Expected: The program terminates, having been interrupted
Actual: Nothing, the program continues uninterrupted.
Side Note 1: I tried this with jna and also with nativeSignals(true) set. Neither changed the outcome.
Side Note 2: If you comment out
enterRawMode
then windows will show a "Terminate Batch Job (Y/N)" question when you press Ctrl-C. And otherwise the non-raw-mode experience on Windows seems to work fine. But commenting out "enterRawMode" on Linux totally breaks the experience, causing duplicate text to show up when you press ENTER.To solve this problem in my own code, I'm thinking of a few choices:
so if there's any advice anyone could share here, that would be appreciated.
The text was updated successfully, but these errors were encountered: