From: Kevin Lamonte Date: Wed, 28 Aug 2019 01:53:40 +0000 (-0500) Subject: also check for text cell size X-Git-Tag: fanfix-swing-0.0.1~12^2~13^2~32 X-Git-Url: https://git.nikiroo.be/?a=commitdiff_plain;h=739ada621a9220c1764172118efe68d3e26db18a;p=fanfix-swing.git also check for text cell size --- diff --git a/README.md b/README.md index 7bf9afdf..4a06a55f 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ The table below lists terminals tested against Jexer's Xterm backend: | rxvt-unicode | X11 | yes | yes | no(2) | | xfce4-terminal | X11 | yes | yes | no | | kitty(3) | X11 | yes | yes | no | +| mintty | Windows | yes | yes | no | | aminal(3) | X11 | yes | no | no | | konsole | X11 | yes | no | no | | yakuake | X11 | yes | no | no | diff --git a/src/jexer/backend/ECMA48Terminal.java b/src/jexer/backend/ECMA48Terminal.java index 3fc6c209..98848355 100644 --- a/src/jexer/backend/ECMA48Terminal.java +++ b/src/jexer/backend/ECMA48Terminal.java @@ -2760,6 +2760,27 @@ public class ECMA48Terminal extends LogicalScreen heightPixels = 400; } } + if ((params.size() > 2) && (params.get(0).equals("6"))) { + if (debugToStderr) { + System.err.printf("windowOp text cell pixels: " + + "height %s width %s\n", + params.get(1), params.get(2)); + } + try { + widthPixels = width * Integer.parseInt(params.get(2)); + heightPixels = height * Integer.parseInt(params.get(1)); + } catch (NumberFormatException e) { + if (debugToStderr) { + e.printStackTrace(); + } + } + if (widthPixels <= 0) { + widthPixels = 640; + } + if (heightPixels <= 0) { + heightPixels = 400; + } + } resetParser(); return; default: @@ -2794,7 +2815,9 @@ public class ECMA48Terminal extends LogicalScreen * @return the string to emit to xterm */ private String xtermReportWindowPixelDimensions() { - return "\033[14t"; + // We will ask for both window and text cell dimensions, and + // hopefully one of them will work. + return "\033[14t\033[16t"; } /**