Use external mode for term when running key bindings

Prior to this fix, when key binding is a script command (i.e. not a
readline command), fish would run that key binding using fish's shell
tty modes. Switch to using the external tty modes. This re-fixes
issue #2214.
This commit is contained in:
ridiculousfish
2020-11-19 19:15:41 -08:00
parent 21e2b39fa8
commit 5f16a299a7
3 changed files with 49 additions and 0 deletions

View File

@@ -43,3 +43,31 @@ expect_prompt("has stopped")
sendline("fg")
sleep(0.1) # allow tty to transfer
send("\x03") # control-c to cancel it
expect_prompt()
sendline("jobs")
expect_prompt("jobs: There are no jobs")
# Regression test for #2214: foregrounding from a key binding works!
sendline(r"bind \cr 'fg >/dev/null 2>/dev/null'")
expect_prompt()
sendline("$fish_test_helper print_stop_cont");
sleep(0.2)
send("\x1A") # ctrl-z
expect_prompt("SIGTSTP")
sleep(0.1)
send("\x12") # ctrl-r, placing fth in foreground
expect_str("SIGCONT")
# Do it again.
send("\x1A")
expect_str("SIGTSTP")
sleep(0.1)
send("\x12")
expect_str("SIGCONT")
# End fth by sending it anything.
send("\x12")
sendline("derp")
expect_prompt()