X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTTerminalWindow.java;h=d1936535c63e5a41bc0a1a06eede35a20e7c5a4c;hb=1b1206070bb94d706c14400b8332a81646b77a25;hp=89280fd1d4d18d1b0a4ff0c05139dc916bb8c56a;hpb=1d99a38f2b0f1f6674a21ba8b17be28bc7a34035;p=fanfix.git diff --git a/src/jexer/TTerminalWindow.java b/src/jexer/TTerminalWindow.java index 89280fd..d193653 100644 --- a/src/jexer/TTerminalWindow.java +++ b/src/jexer/TTerminalWindow.java @@ -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. */