Commit c3b3ef19 introduced a regression when invoking the
clear-history-and-reset action. While RIS (Reset to Initial State) is
specified in DEC STD-070 as homing the cursor, konsole has grown some
hacks in the name of usability to preserve the command prompt line.
For a long time, it has sent two SIGWINCH with changed sizes after clear
and reset actions to force the shell to redraw the prompt (see d346a2cc,
temporarily disabled on 5d61b69e and re-added on 82778e87), which works
for bash, zsh, ksh, ...
tcsh doesn't redraw its prompt on SIGWINCH, but commit b8e96bcd modified
Screen::refresh() so instead of clearing the entire screen and homing
the cursor, it scrolled up everything but the last (usually the prompt)
line.
So, keep that last hack when called from clear-history-and-reset, and
behave as specified on DEC STD-070 otherwise.
Note that other ways of clearing the screen don't need hacks, e.g.
Ctrl-L, if handled at all, is handled by the shell, which then redraws
its prompt. Calling "clear" or invoking "printf '\ec'" will result in
the shell redrawing its prompt in the usual way.
BUG: 453568
Moving all cursor and scroll handling to addPlacement.
This requires the moveCursor parameter to have three possible values,
since Sixel cursor movement is not the same as Kitty/iterm2. This also
unnecessitates addPlacement return value.
BUG: 452476
(cherry picked from commit 9ae57f4e1de920d1a30b8f64448fd6c186a36730)
In 1341088b I added two optional parameters, to addPlacement call, but
in the wrong place.
(cherry picked from commit 70aecfe9283d0205337633be111088ab46623144)
Commit e0b4b96a85 introduced a bug where
the cursor did not move when drawing a sixel image, even when sixel
scrolling mode is set.
(cherry picked from commit 336e310fab88646ae32a58614592b48258d9d6a4)
- Better handling of data pointer and errors for compressed data in kitty protocol
- Correct handling of iterator when erasing a placement.
- Use midRef() instead of mid().
Commit 89101dc5 introduced APC for the first time in konsole, to support
the kitty graphics protocol. Unfortunately, it only properly ended the
parsing of APC for kitty graphics APC, causing any other APC to leave
konsole in a broken state (e.g. when running esctest).
DECSTR is a level 2 control (VT2xx and up), and is to be used instead of
RIS (Reset to Initial State), which can initiate a self-test and drop
the connection on some hardware terminals.
BUG: 134892
If the window size is not an integer multiple of the font size, there are a few pixel left.
Images may only appear where text may, so don't report those pixels in reply to CSI 14 t.
As Christian Persch noted, commit 6158567c announces more extensions
than konsole supports. Tone it down a little. For consistency, also
self-identify as VT220 in DA2.
BUG: 450407
- Abort Sixel mode on any escape sequence other than ESC ESC or ESC \
Fixes one bug described here: https://bugs.kde.org/show_bug.cgi?id=449799
- Ignore control characters inside sixel sequences
- Use the same default colors for sixel as the VT340
- Image display position relative to top left of text display, instead of top left of terminal widget.
Fixes a problem described here: https://bugs.kde.org/show_bug.cgi?id=449799
- Improve cursor positioning and scrolling after displaying an image
- Now the cursor ends in the same place relative to image regardless of whether scrolling is needed.
- If the image fills the whole width of the terminal, the cursor is placed at the start of the line after the image (kitty and iterm protocols).
- Keep images in place when resizing the window vertically
Improve the logic for avoiding doing reflow of zsh prompts (zsh will
repaint the prompt and command line) when there are semantic prompt
markers (OSC 133).
BUG: 447830
This allows for showing graphics in the terminal.
konsole keeps two lists of graphics to display (called placements).
Each placement includes:
- A pixmap to display.
- Column and row where the image is displayed.
- A z index. The text has z=0, so placements with z<0 are displayed below the text.
- An opacity value with which the pixmap is drawn.
- Whether the graphics scrolls with the text
Graphics placements with pid >= 0 are managed by the application, which can remove them. They need to have a unique <id,pid> pair.
Placements with pid<0 are not managed by the application. They are deleted automatically when they are completely obscured by others.
The escape sequence parser in Vt102Emulation is fuzzy in classifying sequences.
The commit move it a bit nearer to parsing according to the widely accepted
terminal sequence structure by restricting CSI (from ecma-48) parsing rules
from rules applicable to non CSI sequences and common parsing rules.
This tightens up parsing of non CSI sequences. Sequences like ESC % = now
no longer are misinterpreted as unfinished but as complete sequence which
matches how other terminals tokenize and also matches the emca-35 syntax.
This is done by moving most of the parsing rules to branches of an
if-statement conditional on the first 2 characters in tokenBuffer.
No functional change.
Instead of sending one char at a time through a virtual function, send
all at once and process them in a loop inside the function. The perf
improvement is not that big from this (+100ms), but it lays down path
for more possible optimizations
Cursor Position Report should return coordinates relative to the top
margin if DEC Origin Mode is set.
From esctest:
CUPTests.test_CUP_RespectsOriginMode