You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ff...@apache.org on 2012/09/11 03:41:18 UTC

svn commit: r1383213 - in /karaf/branches/karaf-2.2.x/shell/console/src/main: filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties java/org/apache/karaf/shell/console/jline/Console.java

Author: ffang
Date: Tue Sep 11 01:41:18 2012
New Revision: 1383213

URL: http://svn.apache.org/viewvc?rev=1383213&view=rev
Log:
[KARAF-1757]Welcome message incorrect during ssh session or using bin/client.

Added:
    karaf/branches/karaf-2.2.x/shell/console/src/main/filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties
Modified:
    karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java

Added: karaf/branches/karaf-2.2.x/shell/console/src/main/filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/shell/console/src/main/filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties?rev=1383213&view=auto
==============================================================================
--- karaf/branches/karaf-2.2.x/shell/console/src/main/filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties (added)
+++ karaf/branches/karaf-2.2.x/shell/console/src/main/filtered-resources/org/apache/karaf/shell/console/branding-ssh.properties Tue Sep 11 01:41:18 2012
@@ -0,0 +1,34 @@
+##
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##  http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+
+welcome = \
+\u001B[36m        __ __                  ____      \u001B[0m\r\n\
+\u001B[36m       / //_/____ __________ _/ __/      \u001B[0m\r\n\
+\u001B[36m      / ,<  / __ `/ ___/ __ `/ /_        \u001B[0m\r\n\
+\u001B[36m     / /| |/ /_/ / /  / /_/ / __/        \u001B[0m\r\n\
+\u001B[36m    /_/ |_|\\__,_/_/   \\__,_/_/         \u001B[0m\r\n\
+\r\n\
+\u001B[1m  Apache Karaf\u001B[0m (${project.version})\r\n\
+\r\n\
+Hit '\u001B[1m<tab>\u001B[0m' for a list of available commands\r\n\
+   and '\u001B[1m[cmd] --help\u001B[0m' for help on a specific command.\r\n\
+Hit '\u001B[1mosgi:shutdown\u001B[0m' to shutdown Karaf.\r\n\
+Hit '\u001B[1m<ctrl-d>\u001B[0m' or '\u001B[1mlogout\u001B[0m' to disconnect shell from current session.\r\n
+
+

Modified: karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java
URL: http://svn.apache.org/viewvc/karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java?rev=1383213&r1=1383212&r2=1383213&view=diff
==============================================================================
--- karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java (original)
+++ karaf/branches/karaf-2.2.x/shell/console/src/main/java/org/apache/karaf/shell/console/jline/Console.java Tue Sep 11 01:41:18 2012
@@ -326,7 +326,12 @@ public class Console implements Runnable
 
     protected Properties loadBrandingProperties() {
         Properties props = new Properties();
-        loadProps(props, "org/apache/karaf/shell/console/branding.properties");
+        if (terminal.getClass().getName().endsWith("SshTerminal")) {
+            //it's a ssh client, so load branding seperately
+            loadProps(props, "org/apache/karaf/shell/console/branding-ssh.properties");
+        } else {
+            loadProps(props, "org/apache/karaf/shell/console/branding.properties");
+        }
         loadProps(props, "org/apache/karaf/branding/branding.properties");
         return props;
     }