Skip to content

Commit

Permalink
Add some doc about Signal.QUIT which can not be caught by the JVM (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 22, 2023
1 parent 0365a9c commit 8c9a4ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions terminal/src/main/java/org/jline/terminal/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ interface SignalHandler {
void handle(Signal signal);
}

/**
* Registers a handler for the given {@link Signal}.
* <p>
* Note that the JVM does not easily allow catching the {@link Signal#QUIT} signal, which causes a thread dump
* to be displayed. This signal is mainly used when connecting through an SSH socket to a virtual terminal.
*
* @param signal the signal to register a handler for
* @param handler the handler
* @return the previous signal handler
*/
SignalHandler handle(Signal signal, SignalHandler handler);

void raise(Signal signal);
Expand Down

0 comments on commit 8c9a4ab

Please sign in to comment.