[前][次][番号順一覧][スレッド一覧]

ruby-changes:37268

From: nobu <ko1@a...>
Date: Tue, 20 Jan 2015 13:09:30 +0900 (JST)
Subject: [ruby-changes:37268] nobu:r49349 (trunk): redmine-backporter.rb: get rid of wrapping

nobu	2015-01-20 13:09:13 +0900 (Tue, 20 Jan 2015)

  New Revision: 49349

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49349

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

  Modified files:
    trunk/tool/redmine-backporter.rb
Index: tool/redmine-backporter.rb
===================================================================
--- tool/redmine-backporter.rb	(revision 49348)
+++ tool/redmine-backporter.rb	(revision 49349)
@@ -199,10 +199,14 @@ def readline(prompt = '') https://github.com/ruby/ruby/blob/trunk/tool/redmine-backporter.rb#L199
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]