run jexer inside jexer
authorKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 21 Mar 2015 04:04:32 +0000 (00:04 -0400)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Sat, 21 Mar 2015 04:04:32 +0000 (00:04 -0400)
README.md
screenshots/yodawg.png [new file with mode: 0644]
src/jexer/session/TTYSessionInfo.java
src/jexer/tterminal/ECMA48.java

index 1a4190834056c6a0c03bcd50f66d88b9b46f390e..89e852a1213fcf9a44d9ec617a6926293e8106bd 100644 (file)
--- a/README.md
+++ b/README.md
@@ -96,6 +96,8 @@ ambiguous.  This section describes such issues.
     emulation limitations.
 
 
+
+
 Roadmap
 -------
 
@@ -161,3 +163,6 @@ Screenshots
 
 ![Several Windows Open Including A Terminal](/screenshots/screenshot1.png?raw=true "Several Windows Open Including A Terminal")
 
+![Yo Dawg...](/screenshots/yodawg.png?raw=true "Yo Dawg, I heard you
+ like text windowing systems, so I ran a text windowing system inside your
+ text windowing system so you can have a terminal in your terminal.")
diff --git a/screenshots/yodawg.png b/screenshots/yodawg.png
new file mode 100644 (file)
index 0000000..a7d3d31
Binary files /dev/null and b/screenshots/yodawg.png differ
index 080e949b7ef5d8ff3dab6de3112a85d8c31e62a1..4716e26d6c050e4ff22d1beea8505f6d62863914 100644 (file)
@@ -120,8 +120,14 @@ public final class TTYSessionInfo implements SessionInfo {
             String line = in.readLine();
             if ((line != null) && (line.length() > 0)) {
                 StringTokenizer tokenizer = new StringTokenizer(line);
-                windowHeight = Integer.parseInt(tokenizer.nextToken());
-                windowWidth = Integer.parseInt(tokenizer.nextToken());
+                int rc = Integer.parseInt(tokenizer.nextToken());
+                if (rc > 0) {
+                    windowHeight = rc;
+                }
+                rc = Integer.parseInt(tokenizer.nextToken());
+                if (rc > 0) {
+                    windowWidth = rc;
+                }
             }
             while (true) {
                 BufferedReader err = new BufferedReader(
index 017c3c7f1df6b6b347f1f862d9151de06231ce35..d148b39ba00e8d88d906bb9b998e73564903229b 100644 (file)
@@ -3307,17 +3307,31 @@ public class ECMA48 implements Runnable {
      * DECSTBM - Set top and bottom margins.
      */
     private void decstbm() {
-        int top = getCsiParam(0, 1, 1, height) - 1;
-        int bottom = getCsiParam(1, height, 1, height) - 1;
+        boolean decPrivateModeFlag = false;
 
-        if (top > bottom) {
-            top = bottom;
+        for (int i = 0; i < collectBuffer.length(); i++) {
+            if (collectBuffer.charAt(i) == '?') {
+                decPrivateModeFlag = true;
+                break;
+            }
         }
-        scrollRegionTop = top;
-        scrollRegionBottom = bottom;
+        if (decPrivateModeFlag) {
+            // This could be restore DEC private mode values.
+            // Ignore it.
+        } else {
+            // DECSTBM
+            int top = getCsiParam(0, 1, 1, height) - 1;
+            int bottom = getCsiParam(1, height, 1, height) - 1;
 
-        // Home cursor
-        cursorPosition(0, 0);
+            if (top > bottom) {
+                top = bottom;
+            }
+            scrollRegionTop = top;
+            scrollRegionBottom = bottom;
+
+            // Home cursor
+            cursorPosition(0, 0);
+        }
     }
 
     /**