Toggle terminal protocols lazily

Closes #10494
This commit is contained in:
Johannes Altmanninger
2024-05-16 10:52:19 +02:00
parent 6f9d5cf44c
commit 29f2da8d18
9 changed files with 74 additions and 123 deletions

View File

@@ -13,7 +13,7 @@ send, sendline, sleep, expect_prompt, expect_re, expect_str = (
def expect_read_prompt():
expect_re(r"\r\n?read> (\x1b\[\?1004h)?$")
expect_re(r"\r\n?read> $")
def expect_marker(text):
@@ -56,12 +56,12 @@ print_var_contents("foo", "bar")
# read -c (see #8633)
sendline(r"read -c init_text somevar && echo $somevar")
expect_re(r"\r\n?read> init_text(\x1b\[\?1004h)?$")
expect_re(r"\r\n?read> init_text$")
sendline("someval")
expect_prompt("someval\r\n")
sendline(r"read --command='some other text' somevar && echo $somevar")
expect_re(r"\r\n?read> some other text(\x1b\[\?1004h)?$")
expect_re(r"\r\n?read> some other text$")
sendline("another value")
expect_prompt("another value\r\n")

View File

@@ -48,7 +48,7 @@ expect_prompt()
sendline("function postexec --on-event fish_postexec; echo fish_postexec spotted; end")
expect_prompt()
sendline("read")
expect_re(r"\r\n?read> (\x1b\[\?1004h)?$", timeout=10)
expect_re(r"\r\n?read> $", timeout=10)
sleep(0.1)
os.kill(sp.spawn.pid, signal.SIGINT)
expect_str("fish_postexec spotted", timeout=10)