X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Ftterminal%2FECMA48.java;h=4bf7efbc3b6c10c4264f6a2288fc7803923628a4;hb=bfecf074da5a84cfe33ba88351d36ed61601448b;hp=ca32d201a2d4dfa0133fe4806ec094731f7bab73;hpb=1bc08f18257ad47aea41f2c62e7da5d05eb3cc23;p=fanfix.git diff --git a/src/jexer/tterminal/ECMA48.java b/src/jexer/tterminal/ECMA48.java index ca32d20..4bf7efb 100644 --- a/src/jexer/tterminal/ECMA48.java +++ b/src/jexer/tterminal/ECMA48.java @@ -871,10 +871,10 @@ public class ECMA48 implements Runnable { case XTERM: // "I am a VT220" - 7 bit version if (!s8c1t) { - return "\033[?62;1;6;9;4c"; + return "\033[?62;1;6;9;4;22c"; } // "I am a VT220" - 8 bit version - return "\u009b?62;1;6;9;4c"; + return "\u009b?62;1;6;9;4;22c"; default: throw new IllegalArgumentException("Invalid device type: " + type); } @@ -1806,6 +1806,9 @@ public class ECMA48 implements Runnable { // Local echo for everything else printCharacter(keypress.getChar()); } + if (displayListener != null) { + displayListener.displayChanged(); + } } if ((newLineMode == true) && (keypress.equals(kbEnter))) { @@ -7020,19 +7023,20 @@ public class ECMA48 implements Runnable { int x0 = currentState.cursorX; for (int y = 0; y < cellRows; y++) { for (int x = 0; x < cellColumns; x++) { - printCharacter(' '); - cursorLeft(1, false); - if ((x == cellColumns - 1) || (y == cellRows - 1)) { - // TODO: render text of current cell first, then image - // over it. For now, just copy the cell. - DisplayLine line = display.get(currentState.cursorY); - line.replace(currentState.cursorX, cells[x][y]); - } else { - // Copy the image cell into the display. - DisplayLine line = display.get(currentState.cursorY); - line.replace(currentState.cursorX, cells[x][y]); + assert (currentState.cursorX <= rightMargin); + + // TODO: Render text of current cell first, then image over + // it (accounting for blank pixels). For now, just copy the + // cell. + DisplayLine line = display.get(currentState.cursorY); + line.replace(currentState.cursorX, cells[x][y]); + + // If at the end of the visible screen, stop. + if (currentState.cursorX == rightMargin) { + break; } - cursorRight(1, false); + // Room for more image on the visible screen. + currentState.cursorX++; } linefeed(); cursorPosition(currentState.cursorY, x0);