Return-Path: X-Original-To: apmail-karaf-commits-archive@minotaur.apache.org Delivered-To: apmail-karaf-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B399EC35 for ; Fri, 1 Feb 2013 03:39:34 +0000 (UTC) Received: (qmail 36604 invoked by uid 500); 1 Feb 2013 03:39:34 -0000 Delivered-To: apmail-karaf-commits-archive@karaf.apache.org Received: (qmail 36475 invoked by uid 500); 1 Feb 2013 03:39:31 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 36417 invoked by uid 99); 1 Feb 2013 03:39:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 03:39:29 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 03:39:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3C7DA238897F; Fri, 1 Feb 2013 03:39:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1441305 - /karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java Date: Fri, 01 Feb 2013 03:39:09 -0000 To: commits@karaf.apache.org From: ffang@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130201033909.3C7DA238897F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ffang Date: Fri Feb 1 03:39:08 2013 New Revision: 1441305 URL: http://svn.apache.org/viewvc?rev=1441305&view=rev Log: [KARAF-2154]Entering an empty command removes previous command in history Modified: karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java Modified: karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java?rev=1441305&r1=1441304&r2=1441305&view=diff ============================================================================== --- karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java (original) +++ karaf/branches/karaf-2.3.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java Fri Feb 1 03:39:08 2013 @@ -244,7 +244,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();