diff options
author | ☈king <rkingpa@sharpsaw.org> | 2013-02-10 23:47:33 -0600 |
---|---|---|
committer | rkingpa@sharpsaw.org <> | 2013-02-10 23:47:33 -0600 |
commit | 1538bc0990dbd4974ce9ca3a351cb01da0022851 (patch) | |
tree | 25452383c88c6adc8cd30208a3941610db4fc507 | |
parent | 60fe27f17f0af9ca4fd81aa04eb6a8bf74a9d405 (diff) | |
download | pry-1538bc0990dbd4974ce9ca3a351cb01da0022851.tar.gz |
Reopen Readline.output if it is not a tty
-rw-r--r-- | lib/pry/pry_instance.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pry/pry_instance.rb b/lib/pry/pry_instance.rb index 68f1c015..9515666b 100644 --- a/lib/pry/pry_instance.rb +++ b/lib/pry/pry_instance.rb @@ -618,6 +618,9 @@ class Pry end if input == Readline + if !$stdout.tty? && $stdin.tty? && !Pry::Helpers::BaseHelpers.windows? + Readline.output = File.open('/dev/tty', 'w') + end input.readline(current_prompt, false) # false since we'll add it manually elsif defined? Coolline and input.is_a? Coolline input.readline(current_prompt) |