karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1485077 - /karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
Date Wed, 22 May 2013 06:14:08 GMT
Author: ffang
Date: Wed May 22 06:14:08 2013
New Revision: 1485077

URL: http://svn.apache.org/r1485077
Log:
[KARAF-2326]Backspace stops working after shutdown command

Modified:
    karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java

Modified: karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
URL: http://svn.apache.org/viewvc/karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java?rev=1485077&r1=1485076&r2=1485077&view=diff
==============================================================================
--- karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
(original)
+++ karaf/trunk/system/command/src/main/java/org/apache/karaf/system/commands/Shutdown.java
Wed May 22 06:14:08 2013
@@ -74,12 +74,24 @@ public class Shutdown extends AbstractSy
                 if (c < 0) {
                     return null;
                 }
-                System.err.print((char) c);
+                if (c == 127 || c == 'b') {
+                    System.err.print((char) '\b');
+                    System.err.print((char) ' ');
+                    System.err.print((char) '\b');
+                } else {
+                    System.err.print((char) c);
+                }
                 System.err.flush();
                 if (c == '\r' || c == '\n') {
                     break;
                 }
-                sb.append((char) c);
+                if (c == 127 || c == 'b') {
+                    if (sb.length() > 0) {
+                        sb.deleteCharAt(sb.length() - 1);
+                    }
+                } else {
+                    sb.append((char) c);
+                }
             }
             String str = sb.toString();
             if (str.equals("yes")) {



Mime
View raw message