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

SqlLineSignalHandler tries to cancel statement on terminal window resize (WINCH signal) #479

Open
thomassngdata opened this issue Mar 16, 2023 · 0 comments

Comments

@thomassngdata
Copy link

The following method in the SqlLineSignalHandler was adapted in version 1.8.0 to cancel the statement dispatched to the driver upon receiving a CTRL-C signal. But it does not check what type of Terminal.Signal it receives, the WINCH for example is send when the controlling terminal of the process changes size.

public void handle(Terminal.Signal sig) {
    try {
      synchronized (this) {
        if (dispatchCallback != null) {
          dispatchCallback.forceKillSqlQuery();
          dispatchCallback.setToCancel();
        }
      }
    } catch (SQLException ex) {
      throw new RuntimeException(ex);
    }
  }

A check should be added to ignore WINCH (and I think also INFO) signals, from org.jline.terminal.Terminal :

    public static enum Signal {
        INT,
        QUIT,
        TSTP,
        CONT,
        INFO,
        WINCH;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant