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 9ae57f4e1d)
- 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().
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
Korean Hangul can be represented in Unicode either as precomposed Hangul
syllables, or as sequences of alphabetic components called Jamo.
Jamo at U+1100..U+11FF, U+A960..U+A97F, U+D7B0..U+D7FF have conjoining
behavior, a sequence of Jamo for Leading Consonants, Vowels, and
(optionally) Trailing Consonants, in that order, conjoins into a
syllable block, (i.e. a sequence L+V+T*, where + and * have their
typical regex meaning).
To represent a Jamo in isolation, there are several options:
- Use non-conjoining Jamo from U+3130..U+318F (or the halfwidth forms
at U+FFA0..U+FFDF. These blocks covers all Jamo used in modern
Korean, but not all Jamo used in Old Korean.
- Use the fillers at U+115F and U+1160 to substitute for non-existing
Leading Consonants, and Vowels. Fonts may stretch Jamo into a
corner.
- Use Jamo from U+1100..U+11FF, U+A960..U+A97F, U+D7B0..U+D7FF, and
separate them with non-Korean characters. Unicode recommends U+200B
ZERO WIDTH SPACE and U+2060 WORD JOINER for this purpose.
Previously, Konsole treated conjoining Jamo as combining marks which
could apply to any previous character. This commit makes conjoining
Jamo only join when previous Jamo when they form (the beginning) of a
proper L+V+T* syllable. It also fixes the width reported when they
cannot join previous characters, which should now be 2, instead of 0.
These include ZWJ (Zero Width Joiner), ZWNJ (Zero Width Non-Joiner) and
Zero Width Space, which can be used to change the rendering of text,
e.g. forcing or preventing the formation of conjunct forms in Indic
scripts.
Treat them as combining characters, so they end up in an extended
character in the previous character cell.
To test, the output of:
printf "[\u915\u94d\u927] "[\u915\u94d\u200c\u937] [\u915\u94d\u200d\u937]\n"
can be compared against the examples in Figures 12.4 and 12.5 of the
Unicode standard, from the "Explicit Virama (Halant)" and "Explicit
Half-Consonants" sub-sections of the Devanagari section on "South and
Central Asia I" chapter (page 465 in Unicode 14).
~
Combining characters could end up combining with an unrelated character
from the previous line. Now they just disappear, without messing with
the display of unrelated characters.
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.
This action should not be performance critical, so scrolling one line n times seems reasonable.
A solution with better performance requires more changes in addHistLine().
This should solve https://bugs.kde.org/show_bug.cgi?id=449233 .
Regression introduced by 5919c1fd. The selection range is inclusive in
both ends.
Thanks to Chiitoo for reporting and to Yerrey Dev for proposing a
solution.
BUG: 448144
Commit d37d3ac1 "CompactHistoryScroll: Remove _maxLineCount + 5 lines at
a time" caused a regression: addHistLine queried the number of lines in
history before and after adding a line, and if it had not incremented it
assumed one line entered history and another was dropped at the other
end. Now, lines are dropped from history in batches, so take care of
that.
TerminalPainter already takes care of calculating blended colors when
"Always invert the colors of selected text" is off. Move there also the
swapping of fg/bg colors for the inverted colors kind of selections.
This removes one reference to TerminalDisplay from Screen. There is
still another one to support reflow for some zsh configurations.
Every time the selection is changed, the selection text is retrieved to
check whether to enable or disable the copy actions. Besides that, the
selection text is also used for the web search context menu entries.
Better just check if the selection is empty and make a note that the
selection changed, so the next time the context menu is invoked it can
retrieve the current selection text, which should happen much less often
than selection changes.
If the "Trim leading spaces" option is set, we can pass a pointer to the
first non-space character to decodeLine(), no need to first move memory
around.
- Hoist _columns access out of loop.
- Make copyFromScreen more similar to copyFromHistory.
- Use std::copy and std::fill instead of explicit loops.
Prompted by suggestions by Waqar Ahmed.
The profile was checked for every selected character to learn whether it
should be rendered with inverted foreground and background colors, or
with blended colors.
From esctest:
ANSIRCTests.test_SaveRestoreCursor_ResetsOriginMode
DECRCTests.test_SaveRestoreCursor_ResetsOriginMode
DECSETTiteInhibitTests.test_SaveRestoreCursor_ResetsOriginMode
RIS (ESC c) - Hard Reset should move the cursor to (1,1) and clear tab
stops.
From esctest:
RISTests.test_RIS_CursorToOrigin
RISTests.test_RIS_ResetTabs
This change tries to improve the performance when you are outputting a
lot of text to the screen. Result with a 40M text file for me before was
6 seconds which is now down to about 3.5 seconds with this change.
It can still be improved a lot more.
BUG: 443885
Commit 8de0e6c7 mistakenly removed code to cancel the pending wrap flag
(which in konsole is implemented as having the cursor one past the width
of the screen) before the cursor controls CUU, CUD, CUB and BS.
While the behavior may seem counter-intuitive (specially BS and CUB,
where `printf "A\bB"` at the last column results in `BA`), this is the
behavior of VT100, xterm (without reverse-wraparound mode), and, most
importantly, is expected by ncurses.
CCBUG: 399615