bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54681: timeout: Program called by timeout cannot interact with tty s


From: Andreas Schwab
Subject: bug#54681: timeout: Program called by timeout cannot interact with tty stdin when timeout is called by exec()
Date: Sat, 02 Apr 2022 14:21:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.92 (gnu/linux)

On Apr 02 2022, Zhaofeng Yang wrote:

> A simplest example is `timeout 10 timeout 5 cat`. cat cannot read input
> from tty stdin.

That's because timeout creates a new process group by default.  The
outer timeout instance already runs in its own process group curtesy of
the parent shell (and thus remains in that group), but for the inner
instance the process group no longer matches the terminal process group,
and thus the children cannot read from the TTY.  You can use timeout
--foreground to avoid that.

$ timeout 10 timeout --foreground 5 cat

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."





reply via email to

[Prev in Thread] Current Thread [Next in Thread]