karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject karaf git commit: [KARAF-5216] Make sure terminal's attributes are restored correctly when using the client jar
Date Fri, 23 Jun 2017 06:28:41 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x 9ef1031cf -> 7e7a12749


[KARAF-5216] Make sure terminal's attributes are restored correctly when using the client
jar

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

Branch: refs/heads/karaf-4.1.x
Commit: 7e7a12749f67a52f5ea712e1a04fc1e55e1b0468
Parents: 9ef1031
Author: Guillaume Nodet <gnodet@apache.org>
Authored: Fri Jun 23 08:28:34 2017 +0200
Committer: Guillaume Nodet <gnodet@apache.org>
Committed: Fri Jun 23 08:28:34 2017 +0200

----------------------------------------------------------------------
 client/src/main/java/org/apache/karaf/client/Main.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/7e7a1274/client/src/main/java/org/apache/karaf/client/Main.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/karaf/client/Main.java b/client/src/main/java/org/apache/karaf/client/Main.java
index 4162de6..6f246a0 100644
--- a/client/src/main/java/org/apache/karaf/client/Main.java
+++ b/client/src/main/java/org/apache/karaf/client/Main.java
@@ -60,6 +60,7 @@ import org.apache.sshd.common.config.keys.FilePasswordProvider;
 import org.apache.sshd.common.keyprovider.AbstractKeyPairProvider;
 import org.apache.sshd.common.keyprovider.FileKeyPairProvider;
 import org.apache.sshd.common.util.io.NoCloseInputStream;
+import org.apache.sshd.common.util.io.NoCloseOutputStream;
 import org.jline.terminal.Attributes;
 import org.jline.terminal.Attributes.ControlChar;
 import org.jline.terminal.Attributes.InputFlag;
@@ -233,8 +234,9 @@ public class Main {
                         }
                         shell.setEnv("LC_CTYPE", ctype);
                     }
-                    channel.setOut(terminal.output());
-                    channel.setErr(terminal.output());
+                    NoCloseOutputStream output = new NoCloseOutputStream(terminal.output());
+                    channel.setOut(output);
+                    channel.setErr(output);
                     channel.open().verify();
                     if (channel instanceof PtyCapableChannelSession) {
                         registerSignalHandler(terminal, (PtyCapableChannelSession) channel);


Mime
View raw message