geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1157723 - /geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
Date Mon, 15 Aug 2011 06:43:13 GMT
Author: xuhaihong
Date: Mon Aug 15 06:43:13 2011
New Revision: 1157723

URL: http://svn.apache.org/viewvc?rev=1157723&view=rev
Log:
1. Use the same configuration with karaf shell to disable jline terminal, and construct it
from Geronimo side directly
2. Catch more exception types to support console fallback

Modified:
    geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java?rev=1157723&r1=1157722&r2=1157723&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-tool/src/main/java/org/apache/geronimo/deployment/cli/StreamConsoleReader.java
Mon Aug 15 06:43:13 2011
@@ -24,6 +24,8 @@ import java.io.InputStreamReader;
 import java.io.PrintStream;
 import java.io.PrintWriter;
 
+import jline.UnsupportedTerminal;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -49,8 +51,12 @@ public class StreamConsoleReader impleme
 
     public StreamConsoleReader(InputStream in, PrintWriter out) {
         try {
-            jlineConsoleReader = new jline.console.ConsoleReader(in, out);
-        } catch (IOException e) {
+            if ("jline.UnsupportedTerminal".equals(System.getProperty("jline.terminal")))
{
+                jlineConsoleReader = new jline.console.ConsoleReader(in, out, new UnsupportedTerminal());
+            } else {
+                jlineConsoleReader = new jline.console.ConsoleReader(in, out);
+            }
+        } catch (Exception e) {
             logger.warn("Fail to create jline console, some features like password mask will
be disabled", e);
             jlineConsoleEnabled = false;
             keyboard = new BufferedReader(new InputStreamReader(in));



Mime
View raw message