This escape sequence is unique to the VT100 and ANSI emulators. It supports mouse tracking per the implementation in x-term, a VT series emulator written for Linux and X-Windows.
To turn on mouse tracking, issue this escape sequence:
ESC [ ? 9 h
To disable mouse tracking:
ESC [ ? 9 l
When mouse tracking is enabled, clicking on the emulation window will result in the following escape sequence being sent ot the host:
ESC [ M mouse col row
mouse is the mouse button pressed. For the left button a space will be sent, a " character for the middle button and ! for the left button
row is the row number that was clicked on starting with the ! character for row 1
col is the column that was clicked on starting with the ! character for row 1
For example, turning on Mouse Tracking and left-clicking on row 2 column 2 will result in
ESC [ M <space> " "
By default, mouse reporting only sends a report when the mouse button is pressed down. If you also want to receive notification when the mouse button was released, you need to send:
ESC [ ? 1 0 0 0 h
To disable the button released report without disabling the down report, send:
ESC [ ? 1 0 0 0 l