#19 expose home/end for TField
[fanfix.git] / src / jexer / TTerminalWindow.java
index 89280fd1d4d18d1b0a4ff0c05139dc916bb8c56a..d1936535c63e5a41bc0a1a06eede35a20e7c5a4c 100644 (file)
@@ -202,8 +202,7 @@ public class TTerminalWindow extends TScrollableWindow
             pb.redirectErrorStream(true);
             shell = pb.start();
             emulator = new ECMA48(deviceType, shell.getInputStream(),
-                shell.getOutputStream());
-            emulator.setListener(this);
+                shell.getOutputStream(), this);
         } catch (IOException e) {
             messageBox("Error", "Error launching shell: " + e.getMessage());
         }
@@ -349,6 +348,30 @@ public class TTerminalWindow extends TScrollableWindow
         doRepaint();
     }
 
+    /**
+     * Function to call to obtain the display width.
+     *
+     * @return the number of columns in the display
+     */
+    public int getDisplayWidth() {
+        if (ptypipe) {
+            return getWidth() - 2;
+        }
+        return 80;
+    }
+
+    /**
+     * Function to call to obtain the display height.
+     *
+     * @return the number of rows in the display
+     */
+    public int getDisplayHeight() {
+        if (ptypipe) {
+            return getHeight() - 2;
+        }
+        return 24;
+    }
+
     /**
      * Handle window close.
      */