For --mouse: start by disabling mode 1005.

AFAIK, this change doesn't affect any actual terminals, but in theory, it
could matter.
This commit is contained in:
Ryan Prichard 2015-12-19 23:58:13 -08:00
parent 75fe19ae96
commit 2cc2480b38

View File

@ -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
@ -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");
}