sleep(0.050)

send("echo mode changes: $MODE_CHANGES\r")
expect_prompt("\r\nmode changes: default insert default insert\r\n")

# Regression test for #8125.
# Control-C should return us to insert mode.
send("set -e MODE_CHANGES\r")
expect_prompt()

timeout = 0.15

if "CI" in os.environ:
    # This doesn't work under tsan.
    import sys
    print("SKIPPING the last of bind_mode_events.py")
    sys.exit(0)

# Put some text on the command line and then go back to normal mode.
send("echo stuff")
sp.expect_str("echo stuff")
send("\033")
sleep(timeout)

os.kill(sp.spawn.pid, signal.SIGINT)
sleep(timeout)

# We should be back in insert mode now.
send("echo mode changes: $MODE_CHANGES\r")
expect_prompt("\r\nmode changes: default insert\r\n")
Beispiel #2
0
    sp.send,
    sp.sendline,
    sp.sleep,
    sp.expect_str,
    sp.expect_prompt,
)
expect_prompt()

timeout = 0.15

if "CI" in os.environ:
    # This doesn't work under tsan.
    import sys
    print("SKIPPING cancel_event.py")
    sys.exit(0)

# Verify that cancel-commandline does what we expect - see #7384.
send("not executed")
sleep(timeout)
os.kill(sp.spawn.pid, signal.SIGINT)
sp.expect_str("not executed^C")
expect_prompt(increment=False)

sendline("function cancelhandler --on-event fish_cancel ; echo yay cancelled ; end")
expect_prompt()
send("still not executed")
sleep(timeout)
os.kill(sp.spawn.pid, signal.SIGINT)
expect_str("still not executed^C")
expect_prompt("yay cancelled", increment=False)
Beispiel #3
0
#!/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")

# Extended SGR sequences.
sp.send("\x1b[<fooM")
sp.expect_str("reader: Disabling mouse tracking")

sp.send("\x1b[<foobarm")
sp.expect_str("reader: Disabling mouse tracking")

sp.sendline("echo done")