lib/backticks/command.rb in backticks-1.0.0 vs lib/backticks/command.rb in backticks-1.0.1
- old
+ new
@@ -116,10 +116,10 @@
#
# @param [Float,Integer] number of seconds to wait before returning nil
# @return [String,nil] fresh bytes from stdout/stderr, or nil if no output
def capture(limit=nil)
streams = [@stdout, @stderr]
- streams << STDIN if interactive?
+ streams << STDIN if STDIN.tty? && interactive?
ready, _, _ = IO.select(streams, [], [], limit)
# proxy STDIN to child's stdin
if ready && ready.include?(STDIN)