mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
eval: Make putSelfInFg a nop if stdin is not a TTY.
This commit is contained in:
parent
754a43c2b6
commit
a9bfa7cdb2
|
@ -3,6 +3,7 @@
|
|||
package eval
|
||||
|
||||
import (
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
|
@ -12,6 +13,9 @@ import (
|
|||
// Process control functions in Unix.
|
||||
|
||||
func putSelfInFg() error {
|
||||
if !sys.IsATTY(os.Stdin) {
|
||||
return nil
|
||||
}
|
||||
// If Elvish is in the background, the tcsetpgrp call below will either fail
|
||||
// (if the process is in an orphaned process group) or stop the process.
|
||||
// Ignoring TTOU fixes that.
|
||||
|
|
Loading…
Reference in New Issue
Block a user