mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-29 06:13:20 +00:00
c35fe879c7
This changes how fish attempts to protect itself from calling tcsetpgrp() too aggressively. Recall that tcsetpgrp() will "force" itself, if SIGTTOU is ignored (which it is in fish when job control is enabled). Prior to this fix, we avoided SIGTTINs by only transferring the tty ownership if fish was already the owner. This dated from a time before we had really nailed down how pgroups should be assigned. Now we more deliberately assign a job's pgroup so we don't need this conservative check. However we still need logic to avoid transferring the tty if fish is not the owner. The bad case is when job control is enabled while fish is running in the background - here fish would transfer the tty and "steal" from the foreground process. So retain the checks of the current tty owner but migrate them to the point of calling tcsetpgrp() itself.
15 lines
372 B
Python
15 lines
372 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")
|