Demo8 use terminals now
[fanfix.git] / src / jexer / TTerminalWidget.java
index 6efa6490c6383e81564128fae4a96d4fc2899f73..36966a0cb80805adcfd1a68e9482a96739a5af3b 100644 (file)
@@ -447,6 +447,12 @@ public class TTerminalWidget extends TScrollableWidget
                     emulator.writeRemote("\033[8;" + getHeight() + ";" +
                         getWidth() + "t");
                 }
+
+                // Pass the correct text cell width/height to the emulator
+                if (getScreen() != null) {
+                    emulator.setTextWidth(getScreen().getTextWidth());
+                    emulator.setTextHeight(getScreen().getTextHeight());
+                }
             }
             return;
 
@@ -696,10 +702,6 @@ public class TTerminalWidget extends TScrollableWidget
         onResize(new TResizeEvent(TResizeEvent.Type.WIDGET, getWidth(),
                 getHeight()));
 
-        // Pass the correct text cell width/height to the emulator
-        emulator.setTextWidth(getScreen().getTextWidth());
-        emulator.setTextHeight(getScreen().getTextHeight());
-
         // Hide mouse when typing option
         if (System.getProperty("jexer.TTerminal.hideMouseWhenTyping",
                 "true").equals("false")) {