Whenever I press Ctrl-C while realLine() is running, I'm seeing it fire the UserInterruptException twice most of the time. I'm on Windows inside of cmd. This seems to happen whether or not I have the signalHandler in my builder.
If I add a sleep of 200 ms before dealing with it, I don't see the behavior. In this instance, I'm just outputting the message to the user
Use the "exit" command to leave this shell.
and immediately entering another readLine() call.
I think what is happening is that my key down and key up are possibly both firing the handler, and since I'm immediately re-entering the readLine(), the second firing is getting captured as well. That would seem to explain why sleeping for 200 ms before running readLine() again doesn't fire the handler a second time.
Is this a bug?
Do I actually need to set the signal handler since it seems to work regardless?
I also see that Ctrl-D throws an org.jline.reader.EndOfFileException. Cool. Is there any way you can help me understand what the possible signals are, what keystrokes create them, and what Java exceptions to expect? I realize you said that JLine support the typical terminal signals, but that really doesn't help me know what keystrokes will generate what specific Java exceptions.
From my Googling, it seems that the actual keystrokes may be interpreted different based on the termain I'm using so I understand if it's not the same across all OS's etc but a basic guide would be great here.
For instance, I'm seeing the standard *nix terminal is supposed to allow:
Ctrl+C - SIGINT
Ctrl+\ - SIGQUIT
Ctrl+Z - SIGTSTP
Thanks!
~Brad
Developer Advocate
Ortus Solutions, Corp