-
Notifications
You must be signed in to change notification settings - Fork 219
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 behaviour seems inconsistent in different hosts. #958
Comments
Actually, I think there's a problem in your config:
So in your setup, JLine actually does nothing wrt to signal handlers. So you're down to the behaviour of your OS console for both the fact that the application exits or not depending on the local flag, and the echo. If you want JLine to be in control of the INT signal, you need to register a signal handler. Also not that the different behaviour (based on the "caller") could be caused if you're calling the |
Hi, I am trying to build a reproducer for it, but in the meantime I have spotted the following issue with the example provided at https://github.com/jline/jline3/blob/master/builtins/src/test/java/org/jline/example/Example.java (running it via +system). As you can see from the attached screenshots, on both Mac and Linux (using 3.24.0), I can see the following exception closing the application, if I issue CTRL-C fast: which makes me feel there is some race condition in the LineReaderImpl with the signal handlers, possibly the cause of this ticket. |
@lucdono77 I fixed a threading issue with 0028516#diff-dddd64baa0e1929f2b9e8909cfc545a7b568aaa39d60b16c57a030fed004f0b5R1197 I've also raised a fix with #973 which should fix this very case, which probably only happen with the exec terminal though. |
Thanks for the info, I have checked and all seems working properly now. |
Hello,
I have an OSGI based application that uses jline3. I have noticed a different behaviour erasing the line in the console with CTRL-C, with default and without default settings LocalFlag settings.
Linux:
Mac:
Windows:
(On Mac and Linux the instantiated terminals are the same.)
Interestingly, even though the code is the same, when I use my implementation, on the very same host, but from different callers, the behaviour seems different from the one above, for instance, on Linux and Mac the line is properly killed and the ^C char does not appear if I call my implementation from another class. Can multithreading cause a different behaviour of the signals in this latest scenario?
This is an example of my terminal configuration:
This is the fragment that shows how I instantiate the reader with the given terminal:
Thanks for your support.
Regards,
Luca
The text was updated successfully, but these errors were encountered: