aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline.rb
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-31 22:32:47 +0900
committeraycabta <aycabta@gmail.com>2019-05-31 22:33:08 +0900
commit73890d9d79425415774a3a2d72ee5882bc41e5c7 (patch)
treeadb1a5233a10095d9248816b42a3049015f023c6 /lib/reline.rb
parent913661cca08ccc6e2b4fd7367ddafcc7e2569a36 (diff)
downloadruby-73890d9d79425415774a3a2d72ee5882bc41e5c7.tar.gz
Flush I/O immediately if RELINE_STDERR_TTY is set
Diffstat (limited to 'lib/reline.rb')
-rw-r--r--lib/reline.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/reline.rb b/lib/reline.rb
index 0c65d8738a..5f3c0e416e 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -304,6 +304,13 @@ module Reline
def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination)
if ENV['RELINE_STDERR_TTY']
$stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w')
+ class << $stderr
+ alias :old_puts :puts
+ def puts(*v)
+ old_puts(*v)
+ flush
+ end
+ end
end
@@config.read
otio = Reline::IOGate.prep