X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=d148b39ba00e8d88d906bb9b998e73564903229b;hb=039b29a58df4744e72d88546cac77dcdd9754ad2;hp=017c3c7f1df6b6b347f1f862d9151de06231ce35;hpb=a90d3119be3030c35765a00d3cc149f61fd8f69e;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index 017c3c7..d148b39 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -3307,17 +3307,31 @@ public class ECMA48 implements Runnable { * DECSTBM - Set top and bottom margins. */ private void decstbm() { - int top = getCsiParam(0, 1, 1, height) - 1; - int bottom = getCsiParam(1, height, 1, height) - 1; + boolean decPrivateModeFlag = false; - if (top > bottom) { - top = bottom; + for (int i = 0; i < collectBuffer.length(); i++) { + if (collectBuffer.charAt(i) == '?') { + decPrivateModeFlag = true; + break; + } } - scrollRegionTop = top; - scrollRegionBottom = bottom; + if (decPrivateModeFlag) { + // This could be restore DEC private mode values. + // Ignore it. + } else { + // DECSTBM + int top = getCsiParam(0, 1, 1, height) - 1; + int bottom = getCsiParam(1, height, 1, height) - 1; - // Home cursor - cursorPosition(0, 0); + if (top > bottom) { + top = bottom; + } + scrollRegionTop = top; + scrollRegionBottom = bottom; + + // Home cursor + cursorPosition(0, 0); + } } /**