Files
fish-shell/tests/pexpects/disable_mouse.py
ken 199475b6ca Stop disabling mouse tracking
Commit eecc223 (Recognize and disable mouse-tracking CSI events,
2021-02-06) made fish disable mouse reporting whenever we receive a
mouse event.  This was because at the time we didn't have a parser
for mouse inputs.  We do now, so let's allow users to toggle mouse
support with

	printf '\e[?1000h'
	printf '\e[?1000l'

Currently the only mouse even we support is left click (to move cursor
in commandline, select pager items).

Part of #4918
See #12026

[ja: tweak patch and commit message]
2025-11-06 13:02:23 +01:00

33 lines
661 B
Python

#!/usr/bin/env python3
from pexpect_helper import SpawnedProc
sp = SpawnedProc(args=["-d", "reader"])
sp.expect_prompt()
# Verify we correctly disable mouse tracking.
# Five char sequence.
sp.send("\x1b[tDE")
sp.expect_str("reader: mouse event")
# Six char sequence.
sp.send("\x1b[MABC")
sp.expect_str("reader: mouse event")
# Nine char sequences.
sp.send("\x1b[TABCDEF")
sp.expect_str("reader: mouse event")
# sleep to catch up under ASAN
sp.sleep(0.5)
# Extended SGR sequences.
sp.send("\x1b[<1;2;3M")
sp.expect_str("reader: mouse event")
sp.send("\x1b[<1;2;3m")
sp.expect_str("reader: mouse event")
sp.sendline("echo done")
sp.expect_prompt("done")