The mouse wheel is often tedious to click, but right-click is easy.
Already used in many terminals (e.g. Putty), switching between those
supports muscle memory.
If enabled, and right-click is used for pasting, the context-menu
can be displayed by pressing Control key + right-click.
FEATURE: 497675
FEATURE: 519241
GUI: new options in profile controling right-click behavior in Konsole
This adds an option to the settings to clear the selection
after copying.
This is useful for when copy is bound to Ctrl-C (smart copy)
and you want to restore the regular Ctrl-C action after copying.
Without this, it can be confusing when the selection is hidden
in the scroll-back buffer and Ctrl-C doesn't seem to work.
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.