ruby-changes:64238
From: aycabta <ko1@a...>
Date: Thu, 17 Dec 2020 20:24:47 +0900 (JST)
Subject: [ruby-changes:64238] 0158ba7e51 (master): [ruby/reline] Make a log file on windows if debug env is set
https://git.ruby-lang.org/ruby.git/commit/?id=0158ba7e51 From 0158ba7e51cb3fc5a204cb65d1be1618802e08d2 Mon Sep 17 00:00:00 2001 From: aycabta <aycabta@g...> 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 diff --git a/lib/reline.rb b/lib/reline.rb index 6a5f9b2..339b8bc 100644 --- a/lib/reline.rb +++ b/lib/reline.rb @@ -200,7 +200,11 @@ module Reline https://github.com/ruby/ruby/blob/trunk/lib/reline.rb#L200 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 v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/