-
Don Lipari authored
Gerrit Renker: I found an easier test: after making sure that stdin is not redirected, check whether there is a non-negative terminal process group (it is -1 if there is no controlling terminal). Also, I think that the heuristic "only interactive if from login shell" is needlessly complicated/obscure. Most (if not all) shells that support job control place processes in their own process group (pid == pgrp): it now uses this as indicator of interactive mode. The following tests now pass: salloc & # from login shell and from nested shell salloc --no-shell& # ok salloc /bin/date& # wants to be placed into the foreground salloc /bin/date </dev/null & # ok setsid salloc # complains there is no controlling terminal setsid salloc --no-shell& # ok
f815f209
To find the state of this project's repository at the time of any of these versions, check out the tags.