diff options
author | aycabta <aycabta@gmail.com> | 2019-05-31 22:32:47 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-31 22:33:08 +0900 |
commit | 73890d9d79425415774a3a2d72ee5882bc41e5c7 (patch) | |
tree | adb1a5233a10095d9248816b42a3049015f023c6 /lib | |
parent | 913661cca08ccc6e2b4fd7367ddafcc7e2569a36 (diff) |
Flush I/O immediately if RELINE_STDERR_TTY is set
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline.rb | 7 |
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 |