geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r536721 - /geronimo/sandbox/gshell/trunk/gshell-server/gshell-server-telnet/src/main/java/org/apache/geronimo/gshell/server/telnet/TelnetTerminal.java
Date Wed, 09 May 2007 23:45:42 GMT
Author: jdillon
Date: Wed May  9 16:45:41 2007
New Revision: 536721

URL: http://svn.apache.org/viewvc?view=rev&rev=536721
Log:
Fixed (hopefully) weird corruption in telnet jline prompt

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

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=536721&r1=536720&r2=536721
==============================================================================
--- 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
Wed May  9 16:45:41 2007
@@ -74,4 +74,19 @@
     public IO getIO() {
         return io;
     }
+    
+    public int readVirtualKey(final InputStream in) throws IOException {
+        int c = super.readVirtualKey(in);
+        
+        // We need to gobble up the char after a newline (which should be a 0x0) to avoid
weird
+        // prompt corruption muck
+        if (c == 0xd) {
+            int nc = super.readVirtualKey(in);
+            if (nc != 0x0) {
+                throw new IOException("Expected 0x0 after 0xd, found: " + Integer.toHexString(c));
+            }
+        }
+        
+        return c;
+    }
 }



Mime
View raw message