The Impl free function and the public static member had identical logic.
Inline the body into ViewSplitter::containerWidgetForDisplay so both
file-local callers and external callers use the same method.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This makes sure the container visibility is properly set
when minimize/maximize is called
When handling splitters beside each other, sometimes
we do not get the correct parent, but the containerWidget.
In these cases check for their parent, which is a splitter,
and hide it recursively as well.
BUG: 520395
copyToX11Selection() created one QMimeData* and passed it to
setMimeData() twice — once for QClipboard::Selection and once for
QClipboard::Clipboard. Since setMimeData() takes ownership of the
QMimeData object, the second call reuses an already-owned pointer,
which is undefined behavior.
This bug only triggers when supportsSelection() returns true (X11)
AND _autoCopySelectedText is true (profile setting), which is why
it primarily affects X11 users with AutoCopySelectedText enabled
(e.g. under xrdp remote desktop).
Fix: use a lambda to create a fresh QMimeData for each clipboard
mode, so each setMimeData() call gets its own object.
Every time I'm building Konsole from source, I encounter this linking error:
```
Linking CXX shared library ../bin/libkonsoleprivate.so
/usr/bin/x86_64-linux-gnu-ld.bfd : CMakeFiles/konsoleprivate.dir/terminalDisplay/TerminalPainter.cpp.o : dans la fonction « Konsole::TerminalPainter::drawInputMethodPreeditString(QPainter&, QRect const&, Konsole::TerminalDisplay::InputMethodData&, Konsole::Character*) » :
TerminalPainter.cpp:(.text+0x9298) : référence indéfinie vers « Konsole::TerminalDisplay::loc(int, int) const »
/usr/bin/x86_64-linux-gnu-ld.bfd : CMakeFiles/konsoleprivate.dir/terminalDisplay/TerminalPainter.cpp.o : dans la fonction « Konsole::TerminalPainter::drawContents(Konsole::Character*, QPainter&, QRect const&, bool, int, bool, QList<Konsole::LineProperty>, Konsole::CharacterColor const*) » :
TerminalPainter.cpp:(.text+0xab77) : référence indéfinie vers « Konsole::TerminalDisplay::loc(int, int) const »
/usr/bin/x86_64-linux-gnu-ld.bfd : TerminalPainter.cpp:(.text+0xac2b) : référence indéfinie vers « Konsole::TerminalDisplay::loc(int, int) const »
/usr/bin/x86_64-linux-gnu-ld.bfd : TerminalPainter.cpp:(.text+0xc537) : référence indéfinie vers « Konsole::TerminalDisplay::loc(int, int) const »
/usr/bin/x86_64-linux-gnu-ld.bfd : TerminalPainter.cpp:(.text+0xc5eb) : référence indéfinie vers « Konsole::TerminalDisplay::loc(int, int) const »
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/konsoleprivate.dir/build.make:1823: bin/libkonsoleprivate.so.26.03.90] Error 1
make[1]: *** [CMakeFiles/Makefile2:667: src/CMakeFiles/konsoleprivate.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
```
I'm currently building using GCC 15.2.0.
The culprit seems to be this `inline` keyword... removing it fixes the issue with no problems.
Unless there is a specific reason this method was explicitly inlined, maybe it could be simply removed? 🤔
## Summary
This change set adds end-to-end container context awareness to Konsole, so users can clearly see which container they are currently working in (Distrobox/Toolbox/Kapsule/Host) and avoid mistakes across host/container workflows.
## Details
1. Container context detection and state handling
1. Extends container detection flow for supported runtimes (including Distrobox/Toolbox paths).
2. Tracks container context per session, including pending/transition states where detection is still \
being resolved.
2. Container-aware tab/session behavior
1. Applies container-derived tab color context so container sessions are visually distinguishable from \
host sessions.
2. Preserves host behavior as default when no container is active.
3. Active container indicator in the UI
1. Adds a visible container badge/footer indicator to show active container type + name.
2. Makes this indicator split-aware:
1. each split view shows its own container context
2. no single tab-wide badge that can misrepresent mixed split layouts
4. Stable coloring semantics in split mode
1. Prevents tab color from flipping based on split focus changes.
2. Uses stable tab-level color behavior, while detailed per-split container identity is shown in each \
split’s footer.
## Result for users
* You can always tell whether you are on host or inside a container.
* In split layouts, each pane accurately shows its own container context.
* Visual cues are stable and reduce accidental commands in the wrong environment.
## Feature Screenshots
Footer Bar with Type and Name of Container, Selected Container is in Titlebar so you can see it in Alt+Tab window here in \[pmos\]
{width="505" height="410"}
Color Coding in tabs so you can fast identify the running container
{width="549" height="321"}
If in split screen all container are named the same, tab color stays the same
{width="597" height="564"}
If names are different, tab is not colored at all
{width="597" height="564"}
Works also with 2x2
{width="566" height="528"}
Move the four Kitty control sequences (CSI ?u, CSI >Nu, CSI <Nu,
CSI =N;Mu) out of the early special-case in csi_dispatch() and into
processToken() switch cases via the existing token_csi_pr/pg/pl/pq
encoders, matching how every other CSI prefixed sequence is handled.
Bare CSI u (Restore Cursor Position) needs no explicit handling: 'u'
is in neither CPN nor CPS char classes, so it falls through to the
last for-loop branch and dispatches as token_csi_ps('u', 0) ->
restoreCursor(), unchanged from before the Kitty work.
The for-loop branches for </=/> prefixes now forward params.value[0/1]
(instead of 0,0) and break to avoid duplicate dispatch on multi-param
sequences. Preexisting consumers (token_csi_pq('c'), token_csi_pg('c'),
token_csi_pg('q')) ignore p/q so the change is transparent for them.
Architectural pattern suggested in !1212.
CCBUG: 519627
Add a KittyKeyboardEnabled profile property (default: true) with a
checkbox in Edit Profile > Advanced to let users control whether
Konsole accepts Kitty keyboard escape sequences.
When disabled, the CSI u push/pop/query/set sequences are ignored and
key events bypass the Kitty encoder entirely, falling through to legacy
handling. Since the protocol is opt-in by applications, enabling it
merely makes the feature available without changing default behavior.
The setting is piped through Session to Vt102Emulation and applied
via SessionManager::applyProfile().
Add support for the Kitty keyboard protocol, which provides enhanced
keyboard input for terminal applications that opt into it.
The protocol is application-driven: programs push/pop keyboard flags
via escape sequences (CSI >Nu, CSI <Nu, CSI ?u, CSI =N;Mu) to request
enhanced encoding. When active, keys are reported using CSI u sequences
with modifier bits, event types, and optional alternate key / text
codepoint fields depending on the flags.
Implementation:
- KittyKeyMap: maps Qt key codes to Kitty key info (functional, legacy,
CSI_u, or plain keys with their codepoints and legacy encodings)
- Per-screen flag stacks in Vt102Emulation for push/pop/query/set
- handleKittyKeyEvent() encodes key events according to active flags,
including support for modifier-only keys, event type reporting,
alternate key reporting (via xkbcommon), and text-as-codepoints
- Ctrl+letter keys (e.g. Ctrl+C, Ctrl+D) are correctly detected by
deriving keycodes from Qt key values instead of event text, which
contains control characters that were previously rejected
BUG: 519627
OSC 8 handling used a broadcast signal that toggled URL extraction
on all screen buffers. This violates context-local semantics and
can leave inactive buffers in an inconsistent hyperlink state.
Fix by toggling URL extraction only on the active screen, avoiding
cross-buffer state leakage.
When TUI applications update their display using EndOfLine sequences,
iTerm image placements were not removed, causing image to remain.
Fix by adding two logics to clear images as well as texts.
- In the character write path (notcombine), remove placements
under character range.
- In clearImage(), remove placements overlapping the cleared area.
When creating a new split, the newly created TerminalDisplay resets
to the default font size. Copy the VT font from the active pane so
that the font size remains consistent across splits.
Introduces a "Sync profile with system theme" option in General Settings.
Adds a "Sync profile with system theme" option in General settings.
When enabled, separate light and dark profiles can be assigned via Profile settings.
The default profile is hidden while this mode is active, replaced by the light/dark profile pair.
BUG: 449235
#### Fixes:
[BUG: 519468: container discovery fully depends on toolbox despite distrobox being present](https://bugs.kde.org/show_bug.cgi?id=519468)
#### Changes:
Adds a check to the startListContainers functions in ToolboxDetector and DistroboxDetector that signals listContainersFinished({}) if the corresponding executables are not found.
This fix allows container features to be used if user only has either distrobox, toolbox, or kapsule installed.
#### AI Declaration:
Code changes in this commit is assisted with an LLM due to unfamiliarity with the code. The used prompt and response is https://chat.deepseek.com/share/uvqfrhblyfbpb79nzd, which is manually evaluated, implemented, built, and tested to check that it works. The commit and MR messages are written manually.
Since Qt 6.11, QTabBar closes tabs on middle click (QTBUG-141519):
[ChangeLog][QtWidgets] Middle clicking tabs in QTabBar with tabsClosable
set to true will now emit tabCloseRequested.
It conflicts with konsole's own handling. Block signals to avoid it.
That way it's configurable again and closing with a middle click no longer
tries to close it twice, resulting in a crash.
BUG: 515014
Issue: Using Ctrl + Shift + C on selected text causes an automatic scroll to most recent output once the text is deselected.
[BUG: 519251](https://bugs.kde.org/show_bug.cgi?id=519251)
Fix: Do not trigger scroll in `SessionController::trackOutput` on a key release event.
The previous implementation mixed block selection and linear selection
logic, leading to incorrect start/count computation for certain rows.
In particular:
- Block selection should always use a fixed [min, max] column range.
- Linear selection should only apply left bound on the top row and
right bound on the bottom row.
This patch separates the two modes explicitly and ensures consistent
range calculation, preventing negative or invalid counts.