karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1441307 - /karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
Date Fri, 01 Feb 2013 03:43:31 GMT
Author: ffang
Date: Fri Feb  1 03:43:30 2013
New Revision: 1441307

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

Modified:
    karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java

Modified: karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
URL: http://svn.apache.org/viewvc/karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java?rev=1441307&r1=1441306&r2=1441307&view=diff
==============================================================================
--- karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
(original)
+++ karaf/trunk/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
Fri Feb  1 03:43:30 2013
@@ -221,7 +221,12 @@ public class ConsoleImpl implements Cons
             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