Skip to content

Commit dff30a2

Browse files
committed
Make a log file on windows if debug env is set
1 parent e708522 commit dff30a2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/reline.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ def readline(prompt = '', add_hist = false)
200200

201201
private def inner_readline(prompt, add_hist, multiline, &confirm_multiline_termination)
202202
if ENV['RELINE_STDERR_TTY']
203-
$stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w')
203+
if Reline::IOGate.win?
204+
$stderr = File.open(ENV['RELINE_STDERR_TTY'], 'a')
205+
else
206+
$stderr.reopen(ENV['RELINE_STDERR_TTY'], 'w')
207+
end
204208
$stderr.sync = true
205209
$stderr.puts "Reline is used by #{Process.pid}"
206210
end

0 commit comments

Comments
 (0)