I'm trying to obtain the position of the mouse in pixels within an application running in a terminal.
xdotool
will not work in this case, unless ssh -X
was used).The goal is to embed small GUI elements in mostly text-based applications. It is currently possible on quite a few terminal emulators using Sixel, Tektronix or ReGIS do draw things, and \e[1000h
or similar escape codes to get mouse events, unfortunately these mouse events are low-resolution (the coordinates in character cells, not in pixels).
xterm reports the mouse position with pixel resolution with the following escape sequences:
\e[2;1'z
\e['|
Details are described at http://invisible-island.net/xterm/ctlseqs/ctlseqs.html