зеркало из https://github.com/github/ruby.git
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:
Родитель
4b1784c669
Коммит
87bb3275aa
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче