From 0158ba7e51cb3fc5a204cb65d1be1618802e08d2 Mon Sep 17 00:00:00 2001 From: aycabta Date: Wed, 16 Dec 2020 16:28:51 +0900 Subject: [ruby/reline] Make a log file on windows if debug env is set https://github.com/ruby/reline/commit/dff30a2d44 --- lib/reline.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/reline.rb') 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 -- cgit v1.2.3