Describe the problem
Timeout isn't working as expected if both stdout and stderr are redirected.
Steps to reproduce the problem
TTY::Command.new(printer: :quiet).run!('sleep 5', timeout: 1, [:out, :err] => '/dev/null')
Actual behaviour
The code above doesn't fail. It takes 5 seconds to run and ignores the timeout option set to 1 second.
Expected behaviour
The code above should raise an exception.
Describe your environment
- OS version: macOS Ventura 13.5 / Debian 12
- Ruby version: 3.2.2
- TTY::Command version: 0.10.1
Describe the problem
Timeout isn't working as expected if both stdout and stderr are redirected.
Steps to reproduce the problem
Actual behaviour
The code above doesn't fail. It takes 5 seconds to run and ignores the timeout option set to 1 second.
Expected behaviour
The code above should raise an exception.
Describe your environment