Skip to content

Commit

Permalink
For --mouse: start by disabling mode 1005.
Browse files Browse the repository at this point in the history
AFAIK, this change doesn't affect any actual terminals, but in theory, it
could matter.
  • Loading branch information
rprichard committed Dec 20, 2015
1 parent 75fe19a commit 2cc2480
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unix-adapter/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,11 @@ int main(int argc, char *argv[])
termios mode = setRawTerminalMode();

if (args.mouseInput) {
// Start by disabling UTF-8 coordinate mode (1005), just in case we
// have a terminal that does not support 1006/1015 modes, and 1005
// happens to be enabled. The UTF-8 coordinates can't be unambiguously
// decoded.
//
// Enable basic mouse support first (1000), then try to switch to
// button-move mode (1002), then try full mouse-move mode (1003).
// Terminals that don't support a mode will be stuck at the highest
Expand All @@ -390,6 +395,7 @@ int main(int argc, char *argv[])
//
// See misc/MouseInputNotes.txt for details.
writeStr(STDOUT_FILENO,
CSI"?1005l"
CSI"?1000h" CSI"?1002h" CSI"?1003h" CSI"?1015h" CSI"?1006h");
}

Expand Down

0 comments on commit 2cc2480

Please sign in to comment.