It does something, actually, so fix a bug in OSC 1337 state machine: we start the machine on the first character, so process the character immediately after starting the machine.
When selecting, the last line gets an added newline if the characters
returned from copyLineToStream() are less than the cells selected on that
last line.
A weird behaviour was that after running:
printf ' v\n'
printf '\e[KSELECT ME\n'
printf '\e[31m\e[Kselect me\n'
printf '\e[0m ^\n'
selecting "SELECT ME " would add a newline, while
selecting "select me " would not add a newline.
This is a side-effect of clearImage() resizing lines which end with
spaces with the default rendition, so selecting the "SELECT ME" line
would get a count of 9 characters, which would make selecting more than
the initial 9 characters add a newline, while the "select me" line would
have additional spaces with isRealCharacter == false and a non-default
rendition.
Solve it but making copyLineToStream() not count and not pass to
PlainTextDecoder trailing characters where isRealCharacter == false.
Otherwise, weirdness ensues. e.g. if you do:
seq 1 $((LINES)); printf '\e[31m\ec'
and try to select the blank lines, the selection shows the previous
rendition color.
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
When using konsoleprofile multiple settings can be specified separated by
semicolons. The usage output and documenting comments now reflect this.
Also fixes the link to Profile.h.
kpty code is (as of now) unix-only, so konsole as a whole cannot
possibly work on windows (without a thick emulation layer). therefore,
remove the pointless #ifdefs that only reduce the code's legibility.
QFont::weight/setWeight() returns/takes an int in Qt5 and QFont::Weight in
Qt6.
This maintains the same behaviour as implemented in 41693fe9ee.
«the weight used as bold is dependent on selected font's weight. "Regular"
will use "Bold", but e.g. "Thin" will use "Light".»
malloc_trim is indeed a GNU extension, but an extension of glibc.
Relying on __GNUC__ unfortunately doesn't help with that. Check for
the actual presence of malloc_trim with cmake's check_function_exists
instead.
This fixes the build with musl libc, which doesn't come with
malloc_trim.
Co-authored-by: Ahmad Samir <a.samirh78@gmail.com>
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)