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:
parent
4b1784c669
commit
87bb3275aa
1 changed files with 6 additions and 2 deletions
|
@ -199,10 +199,14 @@ def readline(prompt = '')
|
||||||
console = IO.console
|
console = IO.console
|
||||||
console.binmode
|
console.binmode
|
||||||
ly, lx = console.winsize
|
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.print prompt
|
||||||
console.flush
|
console.flush
|
||||||
return gets.chomp if /mswin|mingw/ =~ RUBY_PLATFORM
|
|
||||||
line = ''
|
line = ''
|
||||||
while 1
|
while 1
|
||||||
case c = console.getch
|
case c = console.getch
|
||||||
|
|
Loading…
Reference in a new issue