aboutsummaryrefslogtreecommitdiffstats
path: root/tool/redmine-backporter.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-20 04:09:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-20 04:09:13 +0000
commit87bb3275aaefdda20a7b558c9e9d53c6d4694bbe (patch)
tree84561e45319e5f906f5a416f127f4d49bf98669c /tool/redmine-backporter.rb
parent4b1784c6695b2579ff3081ef4bab4c8a20974a8a (diff)
downloadruby-87bb3275aaefdda20a7b558c9e9d53c6d4694bbe.tar.gz
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
Diffstat (limited to 'tool/redmine-backporter.rb')
-rwxr-xr-xtool/redmine-backporter.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/tool/redmine-backporter.rb b/tool/redmine-backporter.rb
index 4815c52c0f..46346b3fd7 100755
--- a/tool/redmine-backporter.rb
+++ b/tool/redmine-backporter.rb
@@ -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