Commit f24d939
committed
remove workaround for controlling terminal behavior in repl_cmd
This was originally added as a workaround for the behavior of sh to try
to become the terminal process group leader, but no longer relevant
since #25006 removed that flag again:
```
julia> run(detach(`bash -i -c "sleep 0"`))
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
Process(`bash -i -c 'sleep 0'`, ProcessExited(0))
```
Julia recieves SIGTTOU when a process like "sh -i -c" exits (at least
for bash and zsh, but not dash, ksh, or csh), since "sh -i" sometimes
takes over the controlling terminal, causing julia to stop once the bash
process exits. This can be quite annoying, but julia goes through some
pains (in libuv) to ensure it doesn't steal the controlling terminal
from the parent, and apparently bash is not so careful about it.
However, since PR #25006, julia hasn't needed this workaround for this
issue, so we can now follow the intended behavior when the child is in
the same session group and steals the controlling terminal from the
parent. Even if such behavior seems odd, this seems to be the intended
behavior per posix design implementation that it gets SIGTTOU when julia
later tries to change mode (from cooked -> raw after printing the
prompt): http://curiousthing.org/sigttin-sigttou-deep-dive-linux.
```
$ ./julia -q
shell> bash -i -c "sleep 1"
[1]+ Stopped ./julia
julia> run(`zsh -i -c "sleep 0"`)
Process(`zsh -i -c 'sleep 0'`, ProcessExited(0))
julia>
[1]+ Stopped ./julia
```1 parent 1735d8f commit f24d939
1 file changed
+4
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | 35 | | |
39 | 36 | | |
40 | 37 | | |
| |||
64 | 61 | | |
65 | 62 | | |
66 | 63 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
73 | 67 | | |
74 | 68 | | |
75 | 69 | | |
76 | 70 | | |
77 | 71 | | |
78 | | - | |
79 | | - | |
| 72 | + | |
80 | 73 | | |
81 | 74 | | |
82 | 75 | | |
| |||
0 commit comments