Updated Branches:
  refs/heads/master 5b8862dd0 -> 6fb138811

[KARAF-2632] Handle backslashes at end of line in the console


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/6fb13881
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/6fb13881
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/6fb13881

Branch: refs/heads/master
Commit: 6fb13881143dfc69995993fd1306a2186455f7e2
Parents: 5b8862d
Author: Guillaume Nodet <[email protected]>
Authored: Tue Dec 17 23:56:24 2013 +0100
Committer: Guillaume Nodet <[email protected]>
Committed: Wed Dec 18 00:01:21 2013 +0100

----------------------------------------------------------------------
 .../org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/6fb13881/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
----------------------------------------------------------------------
diff --git 
a/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
 
b/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
index 2f7b37e..2ae105e 100644
--- 
a/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
+++ 
b/shell/console/src/main/java/org/apache/karaf/shell/console/impl/jline/ConsoleImpl.java
@@ -260,7 +260,11 @@ public class ConsoleImpl implements Console {
             if (command == null) {
                 command = line;
             } else {
-                command += " " + line;
+                if (command.charAt(command.length() - 1) == '\\') {
+                    command = command.substring(0, command.length() - 1) + 
line;
+                } else {
+                    command += "\n" + line;
+                }
             }
             if (reader.getHistory().size() == 0) {
                 reader.getHistory().add(command);

Reply via email to