diff options
author | aycabta <aycabta@gmail.com> | 2020-12-16 16:28:51 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-12-17 20:17:11 +0900 |
commit | 0158ba7e51cb3fc5a204cb65d1be1618802e08d2 (patch) | |
tree | 8ff80f64b149799c2c09291704e58463e6a2b3b3 | |
parent | 2b8fa7817643a9ac7632b66ffed7cb5fd3753966 (diff) | |
download | ruby-0158ba7e51cb3fc5a204cb65d1be1618802e08d2.tar.gz |
[ruby/reline] Make a log file on windows if debug env is set
https://github.com/ruby/reline/commit/dff30a2d44
-rw-r--r-- | lib/reline.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/reline.rb b/lib/reline.rb index 6a5f9b2390..339b8bc8d7 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -200,7 +200,11 @@ module Reline private def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination) if ENV['RELINE_STDERR_TTY'] - $stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w') + if Reline::IOGate.win? + $stderr = File.open(ENV['RELINE_STDERR_TTY'], 'a') + else + $stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w') + end $stderr.sync = true $stderr.puts "Reline is used by #{Process.pid}" end |