1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

redmine-backporter.rb: get rid of wrapping

* tool/redmine-backporter.rb (readline): get rid of wrapping at
  the right edge on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-01-20 04:09:13 +00:00
parent 4b1784c669
commit 87bb3275aa

View file

@ -199,10 +199,14 @@ def readline(prompt = '')
console = IO.console
console.binmode
ly, lx = console.winsize
cls = "\r" + (" " * lx) + "\r" + prompt
if /mswin|mingw/ =~ RUBY_PLATFORM or /^(?:vt\d\d\d|xterm)/i =~ ENV["TERM"]
cls = "\r\e[2K"
else
cls = "\r" << (" " * lx)
end
cls << "\r" << prompt
console.print prompt
console.flush
return gets.chomp if /mswin|mingw/ =~ RUBY_PLATFORM
line = ''
while 1
case c = console.getch