geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r535688 - in /geronimo/sandbox/gshell/trunk: gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java pom.xml
Date Mon, 07 May 2007 00:13:37 GMT
Author: jdillon
Date: Sun May  6 17:13:36 2007
New Revision: 535688

URL: http://svn.apache.org/viewvc?view=rev&rev=535688
Log:
Revert back to jline 0.9.9, something is broke with 0.9.91 with TelnetTerminal
Add some debugging of TelnetTerminal and sync up some changes with jline

Modified:
    geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java
    geronimo/sandbox/gshell/trunk/pom.xml

Modified: geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java?view=diff&rev=535688&r1=535687&r2=535688
==============================================================================
--- geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java
(original)
+++ geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java
Sun May  6 17:13:36 2007
@@ -31,7 +31,8 @@
 
 /**
  * Telnet <a href="http://jline.sf.net">JLine</a> terminal implementation
- * backed up by a <a href="http://www.bway.net/~lichtner/nvt4j.html">NVT4J</a>
terminal instance.
+ * backed up by a <a href="http://www.bway.net/~lichtner/nvt4j.html">NVT4J</a>
+ * terminal instance.
  *
  * @version $Rev$ $Date$
  */
@@ -122,7 +123,27 @@
     public static final short HOME_CODE = 72;
 
     public static final short END_CODE = 70;
-
+    
+    public static final short O_PREFIX = 79;
+    
+    public int readCharacter(final InputStream in) throws IOException {
+        int c = in.read();
+        
+        if (log.isDebugEnabled()) {
+            String ch;
+            if (c == 0xd) {
+                ch = "\\n";
+            }
+            else {
+                ch = new String(new char[] { (char)c });
+            }
+            
+            log.debug("Read char: " + ch + " (0x" + Integer.toHexString(c) + ")");
+        }
+        
+        return c;
+    }
+    
     public int readVirtualKey(final InputStream in) throws IOException {
         assert in != null;
 
@@ -139,7 +160,7 @@
         if (c == ARROW_START) {
             c = readCharacter(in);
 
-            if (c == ARROW_PREFIX) {
+            if (c == ARROW_PREFIX || c == O_PREFIX) {
                 c = readCharacter(in);
 
                 switch (c) {
@@ -162,6 +183,10 @@
                         return CTRL_E;
                 }
             }
+        }
+        
+        if (c > 128) {
+            throw new IOException("UTF-8 not supported");
         }
 
         return c;

Modified: geronimo/sandbox/gshell/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/gshell/trunk/pom.xml?view=diff&rev=535688&r1=535687&r2=535688
==============================================================================
--- geronimo/sandbox/gshell/trunk/pom.xml (original)
+++ geronimo/sandbox/gshell/trunk/pom.xml Sun May  6 17:13:36 2007
@@ -128,7 +128,7 @@
             <dependency>
                 <groupId>jline</groupId>
                 <artifactId>jline</artifactId>
-                <version>0.9.91</version>
+                <version>0.9.9</version>
             </dependency>
 
             <dependency>



Mime
View raw message