felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ccust...@apache.org
Subject svn commit: r829728 - in /felix/trunk/karaf: pom.xml shell/console/src/main/java/jline/AnsiWindowsTerminal.java
Date Mon, 26 Oct 2009 08:37:07 GMT
Author: ccustine
Date: Mon Oct 26 08:37:06 2009
New Revision: 829728

URL: http://svn.apache.org/viewvc?rev=829728&view=rev
Log:
FELIX-1803 - Unable to edit or backspace on multiline commands

Modified:
    felix/trunk/karaf/pom.xml
    felix/trunk/karaf/shell/console/src/main/java/jline/AnsiWindowsTerminal.java

Modified: felix/trunk/karaf/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/pom.xml?rev=829728&r1=829727&r2=829728&view=diff
==============================================================================
--- felix/trunk/karaf/pom.xml (original)
+++ felix/trunk/karaf/pom.xml Mon Oct 26 08:37:06 2009
@@ -88,7 +88,7 @@
         <jansi.version>1.0</jansi.version>
         <jetty.bundle.version>6.1.14_1</jetty.bundle.version>
         <junit.version>3.8.2_1</junit.version>
-        <jline.version>0.9.95.200909100109</jline.version>
+        <jline.version>0.9.95-20091026.080844</jline.version>
         <log4j.version>1.2.14</log4j.version>
         <maven.version>2.0.9</maven.version>
         <mina.version>2.0.0-M6</mina.version>

Modified: felix/trunk/karaf/shell/console/src/main/java/jline/AnsiWindowsTerminal.java
URL: http://svn.apache.org/viewvc/felix/trunk/karaf/shell/console/src/main/java/jline/AnsiWindowsTerminal.java?rev=829728&r1=829727&r2=829728&view=diff
==============================================================================
--- felix/trunk/karaf/shell/console/src/main/java/jline/AnsiWindowsTerminal.java (original)
+++ felix/trunk/karaf/shell/console/src/main/java/jline/AnsiWindowsTerminal.java Mon Oct 26
08:37:06 2009
@@ -18,14 +18,21 @@
  */
 package jline;
 
+import org.fusesource.jansi.AnsiConsole;
+import org.fusesource.jansi.WindowsAnsiOutputStream;
+
+import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 
 public class AnsiWindowsTerminal extends WindowsTerminal {
 
+    private boolean ansisupported = checkAnsiSupport();
+
     @Override
     public boolean isANSISupported() {
-        return true;
+        return ansisupported;
     }
 
     @Override
@@ -37,4 +44,17 @@
         return super.readCharacter(in);
     }
 
+    public static boolean checkAnsiSupport() {
+        OutputStream dummy = new ByteArrayOutputStream();
+        OutputStream ansiout = AnsiConsole.wrapOutputStream(dummy);
+        try {
+            dummy.close();
+            ansiout.close();
+        } catch (IOException ignore) {
+        }
+
+        return (ansiout instanceof WindowsAnsiOutputStream);
+
+    }
+
 }



Mime
View raw message