karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1441306 - /karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
Date Fri, 01 Feb 2013 03:39:20 GMT
Author: ffang
Date: Fri Feb  1 03:39:19 2013
New Revision: 1441306

URL: http://svn.apache.org/viewvc?rev=1441306&view=rev
Log:
[KARAF-2154]Entering an empty command removes previous command in history 

Modified:
    karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java

Modified: karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java?rev=1441306&r1=1441305&r2=1441306&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
(original)
+++ karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
Fri Feb  1 03:39:19 2013
@@ -248,7 +248,12 @@ public class Console implements Runnable
             if (reader.getHistory().size()==0) {
                 reader.getHistory().add(command);
             } else {
-                reader.getHistory().replace(command);
+                // jline doesn't add blank lines to the history so we don't 
+                // need to replace the command in jline's console history with
+                // an indented one
+                if (command.length() > 0 && !" ".equals(command)) {
+                    reader.getHistory().replace(command);    
+                }                                
             }
             try {
                 new Parser(command).program();



Mime
View raw message