Commit f484d35
authored
Avoid zsh taking over /dev/tty in self-test (#1557)
After running nix-installer self-test in a script on Darwin, if I then
attempt to read from /dev/tty in the same script, it gets suspended by
SIGTTIN. This seems to be a result of running zsh -ic which appears to
take over /dev/tty via tcsetpgrp when doing job control stuff[1]. I can
replicate the issue by running sh -c 'zsh -ic /usr/bin/true && read'. I
haven't traced the exact codepaths, but the job control stuff only seems
to kick in when zsh spawns and waits on a subprocess, so by execing the
command, we seem to avoid the problem. This also avoids keeping the
shell around longer than necessary so this seems like a win-win.
[1] https://github.com/zsh-users/zsh/blob/87c055fb4d076c0d9bfffbef16ac8dd9348903df/Src/utils.c#L4779-L47811 parent be809ab commit f484d35
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
108 | | - | |
| 108 | + | |
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| |||
0 commit comments