Skip to content

Commit

Permalink
Disable Quick Edit Mode with mouse support (fixes #964) (#965)
Browse files Browse the repository at this point in the history
- On windows disable quick edit mode if mouse support
  is requested which allows mouse events to
  get propagated automatically.
- There's no explicit revert for this as it seems
  to get done automatically.
- Without this user would need to know that quick edit
  needs to be disabled which is awkward in conhost
  and even more difficult with new windows terminal
  which doesn't even directly expose these settings
  in the UI.
- Fixes #964
  • Loading branch information
jvalkeal authored Apr 17, 2024
1 parent b982407 commit c8b3caa
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ public abstract class AbstractWindowsTerminal<Console> extends AbstractTerminal
protected static final int ENABLE_MOUSE_INPUT = 0x0010;
protected static final int ENABLE_INSERT_MODE = 0x0020;
protected static final int ENABLE_QUICK_EDIT_MODE = 0x0040;
protected static final int ENABLE_EXTENDED_FLAGS = 0x0080;

protected final Writer slaveInputPipe;
protected final NonBlockingInputStream input;
Expand Down Expand Up @@ -201,6 +202,9 @@ protected void updateConsoleMode() {
}
if (tracking != MouseTracking.Off) {
mode |= ENABLE_MOUSE_INPUT;
// mouse events not send with quick edit mode
// to disable ENABLE_QUICK_EDIT_MODE just set extended flag
mode |= ENABLE_EXTENDED_FLAGS;
}
setConsoleMode(inConsole, mode);
}
Expand Down

0 comments on commit c8b3caa

Please sign in to comment.