* ui components
* right click menu + popups
* settings screen
* various fixes
* presets in config
* zellij prompt - ui elements in the cli
* context menu shortcuts and toggle, keybindings in popups, info popups + zellij prompt notify
* smart config writing and some leftovers
* keybindings/right-click/config editors
* some wrapups
* feat(plugins): add prompt() plugin API for zellij:prompt, dialog forms, and Text labels in widgets
* theme editors
* upstream by-id action types, config env for new panes only, smaller saved menu config, web right-click, example config
* upstreamify
* rustfmt
* fix windows and theme editor layout
* add pr
* fix(kitty-graphics): zlib-compress images forwarded to the host terminal
`emit_kitty_transmit` sent every image to the host as uncompressed RGBA
base64 (`f=32,t=d`), about 20x the size of a PNG the application sent,
and re-sent it on every tab switch, pane split and resize step. Compress
the cached host payload with zlib and tag the transmit with `o=z`, which
the kitty protocol defines as part of its base feature set.
Measured with a headless client at 429x77 (8x17 px cells): a 121 KB PNG
went from 2.4 MB to 163 KB on the wire, a 943 KB PNG from 19.9 MB to
1.9 MB, with no measurable change in server CPU.
Fixes#5596
* fix: conditional zlib compression depending on outer terminal support
* rustfmt
* add pr
---------
Co-authored-by: Aram Drevekenin <[email protected]>
* refactor(plugin-api): share the keybinding protobuf conversions
The conversion between a keybinding table and its protobuf form was written
out four times: once each way for the ModeUpdate and InitialKeybinds events.
Collect them into `keybinds_to_protobuf` and `keybinds_from_protobuf`.
Decoding now drops a binding whose key is missing instead of unwrapping it,
so a malformed or foreign payload can no longer panic the conversion, and a
mode whose key fails to convert costs only that binding rather than every
binding in the mode.
* feat(nested-sessions): carry input mode and keybindings over the protocol
A session hosting a nested session has no way to learn what that session is
doing, so its plugins cannot show hints for the session the user is actually
typing into. Add the three messages that carry it:
- GuestModeUpdate, sent by a guest whenever its input mode changes, so a host
always knows which of the guest's bindings currently apply.
- RequestGuestKeybinds and GuestKeybindsUpdate, a query and its answer, for
the far larger keybinding table. Keeping the table behind a query means it
is fetched once by whoever wants it rather than pushed at every host.
The table travels as an encoded plugin-API payload in an opaque bytes field.
Describing keybindings natively here would mean restating the whole Action
schema in this contract, which the codegen compiles with only its own include
path. Reusing the existing payload also means a host and a guest built from
different Zellij versions exchange whatever both understand and silently drop
the rest, which is the behavior this wire needs.
An input mode is written under the name InputMode::from_str reads, so adding a
mode needs no change to this contract and an unknown mode is rejected rather
than misread.
Peers advertise the new HintReporting capability, so each side can tell
whether the other can take part before asking it anything.
* feat(plugin-api): expose nested session mode and keybinding events
Plugins running in a host session can see that a pane holds a nested guest
session, but they have no way to learn what that guest is doing. A status bar
in the host therefore keeps showing the host's own hints while the user is
descended into the guest, which is the wrong keybinding table for the keys the
user is actually pressing.
Add two events and one command covering that gap:
- Event::NestedSessionModeUpdate reports a guest's input mode as it changes.
- Event::NestedSessionKeybinds delivers a guest's full keybinding table.
- PluginCommand::RequestNestedSessionKeybinds asks a guest pane for that
table, which arrives asynchronously as the event above.
Both events carry the pane the guest runs in and the guest's session name, so
a plugin watching several nested panes can tell them apart. Keybindings are
requested rather than pushed because the table is large and most plugins never
need it.
* feat(nested-sessions): report guest input mode and keybindings to the host
Wire the nested session hint events end to end.
A guest announces the HintReporting capability during the handshake and, from
then on, emits a GuestModeUpdate frame whenever its input mode changes. The
mode is reported on every change rather than only while the host is descended,
so the host already holds the right mode the moment focus arrives and the
status bar does not lag behind the descent.
The host turns each such frame into Event::NestedSessionModeUpdate. It answers
PluginCommand::RequestNestedSessionKeybinds by writing a RequestGuestKeybinds
frame into the guest pane; the guest replies with its keybinding table plus its
current mode, and the host forwards the table as Event::NestedSessionKeybinds.
Requests to guests that did not advertise HintReporting are dropped rather than
written, and frames from panes whose guest is not currently live are ignored,
matching how the other guest-to-host frames are handled.
Both events and the command require the ReadApplicationState permission, the
same gate ModeUpdate uses.
* test(nested-sessions): cover guest mode and keybinding reporting
Unit tests over the contract check that every input mode survives the round
trip under its own name, that a mode name the reading side does not know is
rejected rather than guessed at, and that a keybinding table keeps its modes,
keys and actions across the wire. The undecodable and empty payload cases are
covered too, since a host and a guest may be built from different versions.
Integration tests drive two real sessions bridged through a pane: both sides
advertise hint reporting during the handshake, the guest answers a keybinding
request with a populated table plus its current mode, and the guest reports
each mode change while the user is descended into it.
* test(nested-sessions): drop unknown capabilities without losing known ones
A peer built from a newer Zellij can advertise capabilities this side has
never heard of, so pin down that they are ignored individually rather than
invalidating the whole advertisement.
* feat(nested-sessions): carry the guest's base mode alongside its input mode
A host plugin that only knows a guest's current mode cannot tell which of the
guest's bindings are inherited from its base mode. Zellij's own hint rendering
leans on that distinction: bindings the base mode already advertises are
inherited by every other mode through `shared_except` groups, so repeating them
in each mode is noise. Without the guest's base mode a host plugin either
suppresses the wrong bindings or suppresses none.
A guest with a non-Normal base mode, such as an unlock-first config, is where
this shows: assuming Normal there hides the wrong half of its bindings.
The base mode rides along on the existing mode message, so a guest that has not
switched modes yet still reports one, resolved the way the rest of Screen
resolves it (the configured default mode is the base). It stays optional on the
wire, so a name the reading side does not recognize costs only the
inherited-binding distinction rather than the whole message.
* feat(nested-sessions): report the guest's mode when the handshake completes
A guest only pushed its input mode when that mode changed, so a host that
had just picked up a nested session learned nothing about it until the user
happened to switch modes inside it. A host plugin has no other way to tell
which of its panes holds a session worth asking for keybindings, which left
it unable to act on the feature at all in the common case of a guest sitting
in its starting mode.
Send the report once on contact as well, and reuse the same client mode
lookup the keybinding answer already did.
* docs(changelog): note the nested session hint reporting events
* fix(nested-sessions): drop guest keybindings on control characters
Nothing a guest says is authenticated. Its frames travel in the terminal
stream of the pane it runs in, so any program with that pane can write them,
including a keybinding table claiming a binding on a raw control character.
A host that draws those bindings puts their keys on its own screen, where a
control character is a terminal escape in the host's output rather than a
key anyone could press.
Drop them where the guest's payload is decoded, so no host plugin inherits
the problem. Zellij spells the control keys that do exist as their own
BareKey variants, so a Char holding one describes no binding worth keeping.
* test(nested-sessions): expect hint reporting in the announce ack
The host now advertises HintReporting alongside NestedControl when it
acknowledges a guest, so the assertion on the exact capability list had to
follow.
* fix(plugin-api): drop only what has no protobuf form when writing keybindings
keybinds_to_protobuf failed the whole table on the first key or mode it could
not represent, so one unrepresentable binding cost the caller every binding:
a ModeUpdate that failed to convert entirely, and a nested session's answer
that reached its host as an empty table indistinguishable from a session with
no bindings at all.
Drop the individual mode, key or action instead, which is what the reading
half already does and what the writing half already did for actions. A table
now survives the trip between builds minus whatever they do not have in
common.
* fix(nested-sessions): keep a host's view of the guest fresh across a reconfigure
A reconfigure rewrites a session's keybindings and base mode without going
through change_mode, and keybindings are otherwise only ever sent in answer
to a request. A host that had already asked once therefore kept drawing the
table the guest had before its config was reloaded, with no way of noticing
it had gone stale, and would not have picked up the new base mode until the
user happened to switch modes inside the guest.
Report both from reconfigure, next to the shortcut broadcast that already
happens there. Answer a keybinding request from the requesting client's own
table too, since a reconfigure with write_to_disk unset rebinds only the
client that asked: the mode in the same reply already came from that client,
so the two halves now describe the same thing.
* fix: adjust protocol + API
* Update CHANGELOG.md
---------
Co-authored-by: Aram Drevekenin <[email protected]>
* feat: capture OSC 7 working directory on Grid and expose via Pane trait
Add osc7_payload field to Grid, handle the b"7" OSC sequence in
osc_dispatch, expose it via a Grid accessor, add osc7_payload() to
the Pane trait (default None), and implement it on TerminalPane by
delegating to the Grid. Follows the has_bell/consume_bell pattern.
* feat: forward OSC 7 from focused pane to parent terminal on render
* fix: validate OSC 7 URI and clean up state on client disconnect
Reject URIs containing control characters (< 0x20 or 0x7f) to prevent
injection into the parent terminal when the URI is re-emitted via OSC 7
forwarding. Also remove per-client OSC 7 forwarding state in
remove_client() to avoid stale entries accumulating after disconnect.
* style: fix formatting in OSC 7 tests
* fix: add control char test, clear osc7 on reset, doc comment
- Add test for control character rejection in OSC 7 URIs
- Clear osc7_payload in reset_terminal_state() (RIS/\ec)
- Add doc comment on osc7_payload() getter
* fix: address PR review feedback
- Reject C1 control characters (U+0080..U+009F) in OSC 7 URIs using
char::is_control() instead of byte-level check
- Reject entire OSC 7 if any param segment has invalid UTF-8 instead
of silently dropping bad segments
- Avoid String allocation in render hot path by comparing borrowed
&str, only allocating when the value actually changes
- Add test for C1 control character rejection
* fix: integrate OSC 7 forwarding with upstream CWD tracking
* add some more tests
* docs: update changelog
---------
Co-authored-by: Aram Drevekenin <[email protected]>
* fix: stale theme and floating visibility issues, notification bounding
* fix: repaint excess tab surface when closing tab and moving to a smaller one
* fix: keep single-pane tabs when serializing, stop the busy-spin on IPC disconnect, and make client-less CLI actions either work or fail loudly
* fix: some tab closing/ordering issues
* test: integration coverage for OSC 133 selection, scroll retention, paste-read opt-in, theme actions, and input fragmentation
* rendering-width regression tests
* fix: forward alt+mouse events into a guest pane the client is descended into
* fix: alt + [] delay in non-kitty
* allow disabling mouse hover tips while keeping the other effects
* more osc133 actions
* fix: base mode race when changing keybinding presets
* fix compilation warnings
* make releases drafts and remove diagnostic logging
* add pr
* fix(scroll): keep scroll position when leaving scroll mode
Leaving Scroll mode for Normal or Locked snapped the active pane back to
the bottom. Switching panes requires leaving Scroll mode, so that reset
is what prevented keeping a pane scrolled while working in another.
It is also redundant: the scroll keymap already binds an explicit
ScrollToBottom on exit, so users who want to follow live output keep it,
while a plain exit now preserves the scroll position. Output is still
buffered while a pane is scrolled and replayed when scroll is cleared,
so the buffer-overwrite protection is unaffected.
* fix(scroll): re-enter scroll mode when focusing a scrolled pane
Focusing a scrolled pane now switches the client into Scroll mode, and
focusing an unscrolled one returns it to Normal. Only the Normal<->Scroll
pair is synced, so a client in another mode is left alone.
* fix(scroll): re-enter scroll mode on focus-last-pane too
Cover the FocusLastPane action added in #4241 with the same focus-to-scroll
sync as the other focus moves, so landing on a scrolled pane via focus-last
behaves like landing on it via MoveFocus.
* fix(scroll): sync the default mode with scroll, cover mouse focus
Follow imsnif's review on #5299. The focus sync now switches between Scroll
and the configured default mode read from default_mode_info instead of a
hardcoded Normal, so unlock-first sessions (default Locked) return to Locked
rather than Normal. It also fires on mouse focus changes (click, click-through,
focus-follows-mouse) by hooking the existing active-pane diff in
handle_mouse_event, not only keyboard focus moves.
Tests parameterize the focus-sync assertion over the default mode (Normal and
Locked) and add a mouse-click variant.
* cover some more cases
* sync also on mouse scroll
* rustfmt
---------
Co-authored-by: Aram Drevekenin <[email protected]>
* fix(input): realign raw-byte buffer with the keyboard parser to stop stale bytes eating keystrokes
After a paste (e.g. via a clipboard manager like maccy), zellij's
current_buffer can hold up to a few stale bytes that termwiz's
InputParser has already consumed into events. Those stale bytes are then
attached to the raw payload of subsequent KeyEvent messages, desyncing
each keystroke from the bytes that produced it: keys go missing, come
out garbled, or drop into vi command mode.
The root cause is that parse_with_consumed reports consumption relative
to its internal self.buf, while stdin_handler drains a separately
accumulated current_buffer. The two can drift apart whenever a read
leaves a partial sequence that the parser holds under maybe_more.
Reconcile the two after every parse: trim current_buffer to the
parser's buffered length, so no byte the parser has already decoded is
ever forwarded with a later key event. Add InputParser::buffered_len to
the vendored termwiz for that purpose.
* fix: remove parsed bytes from front rather than back
* rustfmt
---------
Co-authored-by: Aram Drevekenin <[email protected]>
* initial chrome
* mobile state
* feat(mobile-web): implement browser→server actions (fit toggle, single-pane fullscreen, pane/tab focus) with fullscreen-truth reconciliation
* panning
* remove mobile plugin
* fix first load race
* improve web handshake
* rustfmt
* cleanups
* moar cleanups
* add bundle asset check to ci
* fix(mobile-web): tab-scope co-presence, yield single-pane to desktop clients, fix render-mode desync
* make mobile use no-ui fullscreen
* client side welcome screen for mobile
* attach web clients to first tab on tiles surface
* fix: opening new pane in mobile single mode no longer exits mobile single mode
* mobile chrome light theme support
* fix server races and flaky tests
* rustfmt
* fix flakes
* add pr
* upgrade insta, rand, sha2, strum, thiserror, tokio-tungstenite, toml, which; drop unused semver and typetag
* upgrade sysinfo to 0.39.5, bump toolchain (msrv) to 1.95.0
* remote legacy yaml config converter and thus drop serde_yaml
* upgrade unicode-width to 0.2.2
* fix(tests): run ipc roundtrip test on a larger stack
* initial implementation
* improve single line title design
* hint text plugin infra
* add proto regen task
* display alt text in status bar
* don't display text with full frames
* style alt hover text
* fix + style control own pane hover
* make multiplayer indications responsive
* update snapshots
* plugin api
* single pane as tab
* better scroll styling
* fix tests
* tab-bar plus hover
* plugin surface tests
* integration tests
* adjust all integration tests
* reduce hover noise
* add pane id to in place
* more integration tests
* style: rustfmt
* update plugin assets
* update assets and snapshots
* add pr