1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Merge pull request #846 from pry/stdout-fix

Output visibility, e.g. for foreman-invoked processes
This commit is contained in:
☈king 2013-02-12 12:34:48 -08:00
commit 293aafd4ea
4 changed files with 14 additions and 0 deletions

BIN
dotdoc.docx Normal file

Binary file not shown.

View file

@ -247,6 +247,15 @@ class Pry
end
def self.auto_resize!
ver = Readline::VERSION
if ver[/edit/i]
warn <<-EOT
Readline version #{ver} detected - will not auto_resize! correctly.
For the fix, use GNU Readline instead:
https://github.com/guard/guard/wiki/Add-proper-Readline-support-to-Ruby-on-Mac-OS-X
EOT
return
end
trap :WINCH do
begin
Readline.set_screen_size *Terminal.size!

View file

@ -395,6 +395,8 @@ class Pry
output.puts "(pry) output error: failed to show result"
end
end
ensure
output.flush if output.respond_to?(:flush)
end
# Force `eval_string` into the encoding of `val`. [Issue #284]

View file

@ -180,6 +180,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)