From 10c8d19d1f9d6dda0ac96cbb108484e9d0ba918a Mon Sep 17 00:00:00 2001 From: strcmp Date: Sat, 22 Aug 2015 15:14:26 +0100 Subject: [PATCH] fix #1464 --- lib/pry/repl.rb | 2 +- lib/pry/terminal.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pry/repl.rb b/lib/pry/repl.rb index 7e93c43c..b0645c21 100644 --- a/lib/pry/repl.rb +++ b/lib/pry/repl.rb @@ -219,7 +219,7 @@ class Pry # # `piping?` returns `true` # % pry | tee log def piping? - !$stdout.tty? && $stdin.tty? && !Pry::Helpers::BaseHelpers.windows? + !($stdout.respond_to?(:tty?) and $stdout.tty?) && $stdin.tty? && !Pry::Helpers::BaseHelpers.windows? end # @return [void] diff --git a/lib/pry/terminal.rb b/lib/pry/terminal.rb index b2140d32..027e56d2 100644 --- a/lib/pry/terminal.rb +++ b/lib/pry/terminal.rb @@ -47,7 +47,7 @@ class Pry::Terminal require 'io/console' begin - if $stdout.tty? && $stdout.respond_to?(:winsize) + if $stdout.respond_to?(:tty?) && $stdout.tty? && $stdout.respond_to?(:winsize) $stdout.winsize end rescue Errno::EOPNOTSUPP