karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject karaf git commit: [KARAF-5280] Suppress welcome message on restarts of shell core
Date Mon, 31 Jul 2017 16:06:11 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.1.x ab47af2ba -> 9ff986db5


[KARAF-5280] Suppress welcome message on restarts of shell core


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

Branch: refs/heads/karaf-4.1.x
Commit: 9ff986db5fcefa9e2e40ed93267f7a5213db25e1
Parents: ab47af2
Author: Christian Schneider <chris@die-schneider.net>
Authored: Mon Jul 31 18:05:37 2017 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Mon Jul 31 18:06:00 2017 +0200

----------------------------------------------------------------------
 .../karaf/shell/impl/console/ConsoleSessionImpl.java      | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/9ff986db/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
----------------------------------------------------------------------
diff --git a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
index de1474d..c2b127e 100644
--- a/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
+++ b/shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -72,6 +72,7 @@ import org.slf4j.LoggerFactory;
 
 public class ConsoleSessionImpl implements Session {
 
+    private static final String SUPPRESS_WELCOME = "karaf.shell.suppress.welcome";
     public static final String SHELL_INIT_SCRIPT = "karaf.shell.init.script";
     public static final String SHELL_HISTORY_MAXSIZE = "karaf.shell.history.maxSize";
     public static final String PROMPT = "PROMPT";
@@ -307,9 +308,12 @@ public class ConsoleSessionImpl implements Session {
             threadIO.setStreams(session.getKeyboard(), out, err);
             thread = Thread.currentThread();
             running = true;
-            Properties brandingProps = Branding.loadBrandingProperties(terminal);
-            welcome(brandingProps);
-            setSessionProperties(brandingProps);
+            if (System.getProperty(SUPPRESS_WELCOME) == null) {
+                Properties brandingProps = Branding.loadBrandingProperties(terminal);
+                welcome(brandingProps);
+                setSessionProperties(brandingProps);
+                System.setProperty(SUPPRESS_WELCOME, "true");
+            }
 
             AtomicBoolean reading = new AtomicBoolean();
 


Mime
View raw message