2021-04-08 06:26:24 +08:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
from pexpect_helper import SpawnedProc
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
|
|
|
|
sp = SpawnedProc(args=["-d", "reader"])
|
|
|
|
sp.expect_prompt()
|
|
|
|
|
|
|
|
# Verify we correctly diable mouse tracking.
|
|
|
|
|
|
|
|
# Five char sequence.
|
|
|
|
sp.send("\x1b[tDE")
|
|
|
|
sp.expect_str("reader: Disabling mouse tracking")
|
|
|
|
|
|
|
|
# Six char sequence.
|
|
|
|
sp.send("\x1b[MABC")
|
|
|
|
sp.expect_str("reader: Disabling mouse tracking")
|
|
|
|
|
|
|
|
# Nine char sequences.
|
|
|
|
sp.send("\x1b[TABCDEF")
|
|
|
|
sp.expect_str("reader: Disabling mouse tracking")
|
|
|
|
|
2024-04-24 02:38:09 +08:00
|
|
|
# sleep to catch up under ASAN
|
|
|
|
sp.sleep(0.5)
|
|
|
|
|
2021-04-08 06:26:24 +08:00
|
|
|
# Extended SGR sequences.
|
2024-03-30 23:56:50 +08:00
|
|
|
sp.send("\x1b[<1;2;3M")
|
2021-04-08 06:26:24 +08:00
|
|
|
sp.expect_str("reader: Disabling mouse tracking")
|
|
|
|
|
2024-03-30 23:56:50 +08:00
|
|
|
sp.send("\x1b[<1;2;3m")
|
2021-04-08 06:26:24 +08:00
|
|
|
sp.expect_str("reader: Disabling mouse tracking")
|
|
|
|
|
|
|
|
sp.sendline("echo done")
|
|
|
|
sp.expect_prompt("done")
|