Skip to content
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

Add some doc about Signal.QUIT which cannot be caught by the JVM (fixes #912) #921

Merged
merged 1 commit into from
Dec 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading