You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by cs...@apache.org on 2017/07/31 16:05:42 UTC
karaf git commit: [KARAF-5280] Suppress welcome message on restarts
of shell core
Repository: karaf
Updated Branches:
refs/heads/master f9e5308f3 -> 8298925b1
[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/8298925b
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/8298925b
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/8298925b
Branch: refs/heads/master
Commit: 8298925b1e748c220d8c7ba41e74e4c4eecd0c4f
Parents: f9e5308
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Mon Jul 31 18:05:37 2017 +0200
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Mon Jul 31 18:05:37 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/8298925b/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();