#51 working OK
[fanfix.git] / src / jexer / TTerminalWindow.java
index a5d92aca58bff5a8daa0aa006f9756492bd50847..9a24305a7b9bb252714ed1a2f043985dc4f64afd 100644 (file)
@@ -153,6 +153,9 @@ public class TTerminalWindow extends TScrollableWindow {
         super(application, i18n.getString("windowTitle"), x, y,
             80 + 2, 24 + 2, flags);
 
+        // Require at least one line for the display.
+        setMinimumWindowHeight(3);
+
         this.closeOnExit = closeOnExit;
         vScroller = new TVScroller(this, getWidth() - 2, 0, getHeight() - 2);
 
@@ -163,7 +166,11 @@ public class TTerminalWindow extends TScrollableWindow {
         newStatusBar(i18n.getString("statusBarRunning"));
 
         // Spin it up
-        terminal = new TTerminalWidget(this, 0, 0);
+        terminal = new TTerminalWidget(this, 0, 0, new TAction() {
+            public void DO() {
+                onShellExit();
+            }
+        });
     }
 
     /**
@@ -198,6 +205,9 @@ public class TTerminalWindow extends TScrollableWindow {
         super(application, i18n.getString("windowTitle"), x, y,
             80 + 2, 24 + 2, flags);
 
+        // Require at least one line for the display.
+        setMinimumWindowHeight(3);
+
         this.closeOnExit = closeOnExit;
         vScroller = new TVScroller(this, getWidth() - 2, 0, getHeight() - 2);
 
@@ -208,7 +218,11 @@ public class TTerminalWindow extends TScrollableWindow {
         newStatusBar(i18n.getString("statusBarRunning"));
 
         // Spin it up
-        terminal = new TTerminalWidget(this, 0, 0);
+        terminal = new TTerminalWidget(this, 0, 0, new TAction() {
+            public void DO() {
+                onShellExit();
+            }
+        });
     }
 
     // ------------------------------------------------------------------------