4 The only specification I could find describing mouse input escape sequences
5 was the /usr/share/doc/xterm/ctlseqs.txt.gz file installed on my Ubuntu
8 Here are the relevant escape sequences:
10 * [ON] CSI '?' M 'h' Enable mouse input mode M
11 * [OFF] CSI '?' M 'l' Disable mouse input mode M
12 * [EVT] CSI 'M' F X Y Mouse event (default or mode 1005)
13 * [EVT6] CSI '<' F ';' X ';' Y 'M' Mouse event with mode 1006
14 * [EVT6] CSI '<' F ';' X ';' Y 'm' Mouse event with mode 1006 (up)
15 * [EVT15] CSI F ';' X ';' Y 'M' Mouse event with mode 1015
17 The first batch of modes affect what events are reported:
19 * 9: Presses only (not as well-supported as the other modes)
20 * 1000: Presses and releases
21 * 1002: Presses, releases, and moves-while-pressed
22 * 1003: Presses, releases, and all moves
24 The next batch of modes affect the encoding of the mouse events:
26 * 1005: The X and Y coordinates are UTF-8 codepoints rather than bytes.
27 * 1006: Use the EVT6 sequences instead of EVT
28 * 1015: Use the EVT15 sequence instead of EVT (aka URVXT-mode)
30 Support for modes in existing terminals
31 =======================================
33 | 9 1000 1002 1003 | 1004 | overflow | defhi | 1005 1006 1015
34 ---------------------------------+---------------------+------+--------------+-------+----------------
35 Eclipse TM Terminal (Neon) | _ _ _ _ | _ | n/a | n/a | _ _ _
36 gnome-terminal 3.6.2 | X X X X | _ | suppressed*b | 0x07 | _ X X
37 iTerm2 2.1.4 | _ X X X | OI | wrap*z | n/a | X X X
38 jediterm/IntelliJ | _ X X X | _ | ch='?' | 0xff | X X X
39 Konsole 2.13.2 | _ X X *a | _ | suppressed | 0xff | X X X
40 mintty 2.2.2 | X X X X | OI | ch='\0' | 0xff | X X X
41 putty 0.66 | _ X X _ | _ | suppressed | 0xff | _ X X
42 rxvt 2.7.10 | X X _ _ | _ | wrap*z | n/a | _ _ _
43 screen(under xterm) | X X X X | _ | suppressed | 0xff | _ _ _
44 urxvt 9.21 | X X X X | _ | wrap*z | n/a | X _ X
45 xfce4-terminal 0.6.3 (GTK2 VTE) | X X X X | _ | wrap | n/a | _ _ _
46 xterm | X X X X | OI | ch='\0' | 0xff | X X X
48 *a: Mode 1003 is handled the same way as 1002.
49 *b: The coordinate wraps from 0xff to 0x00, then maxs out at 0x07. I'm
50 guessing this behavior is a bug? I'm using the Xubuntu 14.04
52 *z: These terminals have a bug where column 224 (and row 224, presumably)
53 yields a truncated escape sequence. 224 + 32 is 0, so it would normally
54 yield `CSI 'M' F '\0' Y`, but the '\0' is interpreted as a NUL-terminator.
56 Problem 1: How do these flags work?
57 ===================================
59 Terminals accept the OFF sequence with any of the input modes. This makes
60 little sense--there are two multi-value settings, not seven independent flags!
62 All the terminals handle Granularity the same way. ON-Granularity sets
63 Granularity to the specified value, and OFF-Granularity sets Granularity to
66 Terminals vary in how they handle the Encoding modes. For example:
68 * xterm. ON-Encoding sets Encoding. OFF-Encoding with a non-active Encoding
69 has no effect. OFF-Encoding otherwise resets Encoding to Default.
71 * mintty (tested 2.2.2), iTerm2 2.1.4, and jediterm. ON-Encoding sets
72 Encoding. OFF-Encoding resets Encoding to Default.
74 * Konsole (tested 2.13.2) seems to configure each encoding method
75 independently. The effective Encoding is the first enabled encoding in this
82 * gnome-terminal (tested 3.6.2) also configures each encoding method
83 independently. The effective Encoding is the first enabled encoding in
88 Mode 1005 is not supported.
90 * xfce4 terminal 0.6.3 (GTK2 VTE) always outputs the default encoding method.