mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 16:41:41 +08:00
5cf0778207
When fish runs with job control enabled, it transfers ownership of the tty to a child process, and then reclaims the tty after the process exits. If job control is disabled then fish does not transfer or reclaim the tty. It may happen that the child process creates a pgroup and then transfers the tty to it. In that case fish will not attempt to reclaim the tty, as fish did not transfer it. Then when fish reads from stdin it will receive SIGTTIN instead of data. Fix this by unconditionally claiming the tty in readline(). Fixes #9181
30 lines
691 B
Python
30 lines
691 B
Python
#!/usr/bin/env python3
|
|
from pexpect_helper import SpawnedProc
|
|
|
|
sp = SpawnedProc()
|
|
sendline, expect_prompt = sp.sendline, sp.expect_prompt
|
|
|
|
expect_prompt()
|
|
sendline("status job-control full")
|
|
expect_prompt()
|
|
|
|
sendline(
|
|
"$fish -c 'status job-control full ; $fish_test_helper report_foreground' &; wait"
|
|
)
|
|
expect_prompt()
|
|
|
|
sendline("echo it worked")
|
|
expect_prompt("it worked")
|
|
|
|
# Regression test for #9181
|
|
sendline("status job-control interactive")
|
|
expect_prompt()
|
|
sendline("$fish_test_helper abandon_tty")
|
|
expect_prompt()
|
|
sendline("echo cool")
|
|
expect_prompt("cool")
|
|
sendline("true ($fish_test_helper abandon_tty)")
|
|
expect_prompt()
|
|
sendline("echo even cooler")
|
|
expect_prompt("even cooler")
|