You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
remove workaround for controlling terminal behavior in repl_cmd (#58554)
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))
```
Long explanation: 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.
For some background on why this is a useful signal and behavior and
should not be just blocked, see nodejs/node#35536.
According to glibc, there's a half page of code for how to correctly
implement a REPL mode change call:
https://www.gnu.org/software/libc/manual/html_node/Initializing-the-Shell.html
```
$ ./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
```
(cherry picked from commit 0cbe466)
0 commit comments