Commit Graph
3410 Commits
Author SHA1 Message Date
Aram Drevekenin 026b599a88 add pr 2026-10-26 11:19:52 +01:00
Aram Drevekenin e12600cf40 feat(resurrection): add set-resurrect-command action to override a pane's resurrect command 2026-10-26 11:13:47 +01:00
Aram Drevekenin 145ed50d8a Drag and pane (#5766)
* feat: ctrl+mouse-drag to get a floating pane

* rustfmt

* add pr
2026-10-26 08:11:12 +01:00
Aram Drevekenin ffb334a949 Pane mirror embed (#5758)
* improve inbox ui

* various fixes

* last minute fixes and ux improvements

* various inbox ui/ux fixes

* single desktop window per session

* fix test

* tests and fmt

* add pr
2026-10-23 17:42:30 +02:00
Aram Drevekenin 7014cb440c perf: improve typing latency in the window (#5757)
* perf: improve typing latency in the window

* fix flaky tests

* rustfmt
2026-10-23 16:39:03 +02:00
Aram Drevekenin c7c4ce42b8 Allow renaming sessions from session mode (#5754)
* feat: allow renaming sessions from session mode

* rustfmt

* fix tests

* manually download protoc

* add pr
2026-10-22 18:11:26 +02:00
Aram Drevekenin a28f3ca9c2 Adjust Setup for Desktop Window (#5750)
* setup wizard

* rustfmt

* fix ci issues

* fix integration tests

* harden flaky tests

* fix ipc creation races
2026-10-22 10:41:39 +02:00
Thomas Linford ccabe137c4 fix(window): restore macOS transparency and keep the see-through shadow cheap (#5748)
- make opacity and blur work again on macOS (lost in #5734)
- cut WindowServer load by using an almost clear window background
2026-10-21 15:08:04 +02:00
Aram Drevekenin bfcdf7ac21 Reduce memory utilization in the terminal grid and desktop window (#5739)
* shrink lines to fit in scrollback

* optimize grid mem

* optimize window mem

* various fixes

* fix: detach races
2026-10-20 16:54:48 +02:00
Aram Drevekenin 3ce7e7dc71 Inbox, notifications, better session-manager, desktop integration (#5734)
* feat(attention): add per-pane attention status with OSC 7501/133/633 parsing, frame symbols, mute/ignore/watch and plugin API

* revamp attention plugin

* desktopify attention

* tests, protobuffs, etc.

* strengthen tests

* desktop integrations

* test cases and hardening

* fix(app): keep tests off the live desktop app socket and recover from a lost socket

* fix(attention): readable tab marks, persist session mute, fix inbox clicks, rename socket, standalone windows and flaky tests

* unify new window keybindings

* fix: return to session shortcut display

* hide hover hints

* rustfmt

* merge

* fix tests

* fix tests

* fix tab-bar race

* fix tests again

* fix: prevent out of order cached pty writes on startup

* add pr
2026-10-20 13:29:16 +02:00
Myah MitchellandAram Drevekenin 014fdd728f fix(configuration): keep config formatting on save and scroll long dialogs (#5729)
* fix(config): edit plugin aliases in place per option

- Saving replaced a changed alias with a rebuilt node, dropping its
  comments, blank lines and option order
- Changed, added and removed options and the location are now edited in
  place; the alias is still replaced when that isn't possible (options
  written as properties, a changed option with several arguments)
- load_plugins entries use the same edit

* fix(configuration): keep spaces in plugin config values

- The pairs field trimmed every value on apply, so saving rewrote
  untouched values and turned " " into ""
- Keys are still trimmed; values are kept as typed, like env values

* fix(configuration): scroll dialog fields that don't fit

- The dialog capped its height at the pane but drew every field, so a
  long option list ran out of the pane with no way to reach it
- Scroll the fields with RowScroll, following focus and the mouse wheel

* docs: add changelog entry for #5729

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-19 15:04:50 +02:00
a655b438ac fix(server): validate session name before deleting dead session cache dir (#5725)
* fix(server): validate session name before deleting dead session cache dir

* fix(sessions): validate the resolved session id before deleting cache folders and reject invalid names on rename

---------

Co-authored-by: carfeii <carfeii@users.noreply.github.com>
Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-19 12:07:43 +02:00
Snehal Reddy c818f98e47 fix(mouse): end selections on release even if the pane tracks the mouse (#5723) 2026-10-19 11:15:27 +02:00
Aram Drevekenin 85e652e06c fix(watchers): stop config, layout and keybind watchers from spinning on dangling symlinks (#5731)
* fix(watchers): stop config, layout and keybind watchers from spinning on dangling symlinks

* add pr
2026-10-19 10:39:13 +02:00
Lucca HuguetandAram Drevekenin 77debdeb2c fix(plugins): replay cached startup events to existing instances (#5706)
* fix(plugins): replay cached startup events when first client connects

* fix(plugins): replay cached events to existing instances

* add pr

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-19 09:42:38 +02:00
divens aa242c0b20 fix(sessions): decouple session names from socket and pipe filenames (#5513)
fix(sessions): decouple session names from socket and pipe filenames (#5513)

A session's socket/named pipe and its session-info cache folder are now
named by a short, stable id (12 hex chars) instead of the session name. The
session index (session_index.sqlite) records each session's id next to its
name. Renaming a session only updates that row and renames nothing on disk,
which fixes reattaching to a renamed session on Windows, where named pipes
cannot be renamed.

- Listing, attaching, kill/delete, resurrection, session previews and
  suggestions, the web client and zellij-window all resolve name <-> id
  through the index. Running vs resurrectable is still read from the
  filesystem.
- Existing indexes gain an id column. Sessions from before ids keep their
  name as their id, so their sockets and saved layouts keep working without
  being moved. A new session never takes the id of a renamed one.
- Ids are short so socket paths fit the 104-byte macOS limit. The client
  checks the socket directory against that length at startup instead of
  checking each session name.
- The server's id is threaded per session rather than through a
  process-global, which keeps the in-process integration-test harness
  working.

Fixes #4998
2026-10-17 23:01:37 +02:00
Aram Drevekenin 519a23715c Grapheme cluster support (#5714)
* initial implementation

* optimizations

* grapheme_clusters config, emoji font, VS15/Hangul/accent rendering fixes

* add pr

* fix flaky tests

* fix more flakes and some races
2026-10-14 11:21:38 +02:00
divens dfa40f44a4 feat(window): Windows support (#5679)
feat(window): Windows support

- Fix: ignore the 0×0 resize sent on minimize, which shrank the tab and corrupted the remembered size.
- Fix: let `notifications` rather than `bell` decide when a notification asks for attention.
- Fix: detect transparency from the alpha bits, since WGL drivers report no transparency support.
- Fix (server): start ConPTY panes on the pseudo console's standard handles.
- Bell via MessageBeep; Acrylic blur on Windows 11 22H2+.
- App identity (AUMID `zellij.window`), with taskbar pinning that reopens the window.
- `zellij-window.exe` launcher with no console, shipped in the zip and MSI.
- An application manifest (PerMonitorV2 DPI, modern controls).
- A log file and a message box for errors when there's no console.
- Start menu shortcut from `--install-desktop-entry`, and optionally from the MSI.
- Desktop notifications as toasts that bring the window forward when clicked.
- Detach and save state on Ctrl+C, console close and sign-out.
- Route the Windows warnings through `report!`.
2026-10-13 21:18:50 +02:00
bc66c40189 feat: zellij terminal window (#5652)
* feat: zellij terminal window

* rustfmt

* improve default theme, bundle Nerd font icons, fix some rendering issues

* opacity

* remember window size

* rustfmt

* pref: improve input echo speed

* font schenanigens: padding, line height, cell width, font weight, etc.

* fullscreen toggle, close confirmation dialog, hide pointer while typing, hollow unfocused cursor, minimum contrast

* smooth scrolling

* scroll momentum

* rustfmt

* fix tests

* fix: show popups only once drawn at their requested size

* session suggestions

* moar suggestion tests

* macos option as alt

* macos system bell

* merge wrapups and tests

* dead keys, font size in points, extra tests

* terminal window config in settings

* shift+mouse highlighting and link-clicking in window

* rustfmt

* adjust window error messages

* confirm on quit

* fix popup and multiplayer cursors, mouse pointer shapes for ui elements

* rebase stragglers

* fix(window): keep a dead key's accent through modifier keys

A dead key followed by a character it can't combine with lost its
accent when that character needed Shift or AltGr: on a French AZERTY
layout, `^` then `/` typed `/` instead of `^/`. The window settled the
accent on the next key press, the Shift or AltGr press included, while
Windows keeps the dead key until a key produces text and reports the
accent in that key's text, which the window then ignored.

Leave a pending accent alone on modifier and lock keys, and type a
character key's text when it carries an accent ahead of the character,
which also covers an accent Windows kept through an arrow key.

(cherry picked from commit 7822bf4c02)

* fix: filter out locked sessions

* rustfmt

* fix e2e

* add pr

---------

Co-authored-by: Thomas Linford <linford.t@gmail.com>
Co-authored-by: divens <divens.dev@gmail.com>
2026-10-12 17:10:13 +02:00
Ellis NieuwpoortandAram Drevekenin 06ece58c1f fix(server): do not remove the socket of another server on exit (#5708)
* fix(server): do not remove the socket of another server on exit

A server that lost the bind race for a session socket panicked, and its
exit cleanup then removed the socket path of the server that won. Only
remove the socket on exit if this server bound it.

* fix(web): start the web server when no default config file path exists (#5707)

* lock the session socket before binding and exit cleanly if another server already holds it

* add pr

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-12 12:00:39 +02:00
Ellis Nieuwpoort a6c3dba3ac fix(web): start the web server when no default config file path exists (#5707) 2026-10-12 10:13:17 +02:00
Aram Drevekenin 333d7898a8 Run keybinding improvements (#5701)
* add ORIGIN_PANE_ID to Run commands started from a keybinding

* RunInBackground

* add pr
2026-10-09 16:14:47 +02:00
Aram Drevekenin 5586646d3f fix(plugins): ignore caller_cwd when matching aliased plugins in LaunchOrFocusPlugin (#5698)
* fix(plugins): ignore caller_cwd when matching aliased plugins in LaunchOrFocusPlugin

* rustfmt
2026-10-09 13:21:40 +02:00
Aram Drevekenin b1033be2a3 Improved mouse handling (#5697)
* configurable mouse bindings

* feat(bars): reorder tabs with mouse drag, clickable status-bar shortcuts with hover effects

* fix tests

* add pr
2026-10-09 11:59:23 +02:00
Aram Drevekenin 9dacbc1982 allow dangerously disabling certificate on non-localhost (#5694)
* allow dangerously disabling certificate on non-localhost

* add pr
2026-10-08 11:26:00 +02:00
Aram Drevekenin 328be6919c fix: client stdout race (#5693) 2026-10-08 10:35:02 +02:00
8LWXpgandAram Drevekenin b24a7a1e3e Add support for mouse horizontal scroll (#4860)
* rebase on upstream/main

* test: implement scroll_left/scroll_right on mock panes

* remove faux handling for left/right and add tests

* add pr

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-07 19:16:33 +02:00
Aram Drevekenin 3cfd57f89a fix(resurrection): stop saving layouts that fail to reload, and attach to live sessions regardless (#5690)
* fix(resurrection): stop saving layouts that fail to reload, and attach to live sessions regardless

* add pr
2026-10-07 14:52:11 +02:00
Aram Drevekenin 52710dcc41 Fix flaky tests (#5688)
* initial fixes

* rustfmt
2026-10-06 14:20:02 +02:00
Myah MitchellandAram Drevekenin 6af3a36eb8 feat(plugin-api): let a plugin give its layout space back while empty (#5590)
* feat(plugin-api): let a plugin give its layout space back while empty

A plugin mounted in a layout as a bar keeps the row the layout reserved
for it even when it has nothing to draw, so an empty bar shows as a blank
line. Nothing in the plugin API could give that row up: HideSelf
suppresses the pane and brings it back through add_tiled_pane, which
re-inserts it by splitting rather than at its layout position, and
CloseSelf does not come back at all.

SetSelfCollapsed takes the pane out of the constraint solve without
taking it out of the layout. The pane keeps its size constraint while it
is out, so a Fixed(1) bar is still Fixed(1) when it rejoins and expanding
restores exactly what the layout asked for, while constrain_spans makes
its neighbors grow over the space in the meantime.

Collapsed panes are tracked separately from panes_to_hide, which
fullscreen overwrites wholesale, so a collapse survives entering and
leaving fullscreen. They are also left out of the viewport offset, since
a pane holding no space must not shrink the viewport, and their state is
dropped when the pane closes so a reused pane id does not arrive already
invisible.

* test(tab): cover collapsing a pane out of the layout and back

Pins down what the collapse is for: the neighbors take the space, the
collapsed pane keeps its size constraint so expanding restores the layout
exactly rather than approximately, and the collapse outlives a fullscreen,
which rebuilds the hidden set from scratch.

Also covers the two ways it should do nothing: a second collapse of an
already collapsed pane, and a pane id that is not in the tab. Closing a
collapsed pane drops the state, so a reused id does not come back
invisible.

* fix(screen): keep one deferred collapse per pane instead of a queue

A plugin sends this whenever its content comes and goes, so a plugin
with no pane in any tab would otherwise leave an entry behind on every
change, all of them replayed the next time a tab is created. Only the
most recent word on a pane means anything, so drop the earlier one.

* fix(tab): keep a collapsed pane's geometry current across a relayout

Being filtered out of the constraint solve is what stops a collapsed pane
from holding space, but it also means nothing writes geometry to it. That
was fine while the tab kept its shape and wrong the moment it did not: the
pane was left describing a display area that no longer existed.

Worse than stale, because the solver reads the layout tree back off where
the panes currently sit. A one-row bar collapsed in a 121x20 tab that then
became 118x23 stayed at y 19 in a tab whose last row was 22, so the next
solve was handed a tree that did not match the screen and gave up. The bar
came back three rows above the bottom, at a width wider than the tab, and
its neighbor never gave the row back.

Let collapsed panes take part in the resize and the relayout, then collapse
them again over the result, which is what fullscreen already does a few
lines above for the same reason.

* docs(changelog): note the plugin collapse command

Links the tracking issue rather than a pull request, since no pull
request is open yet. Wants updating to the pull request URL once there
is one, to match every entry in the released sections.

* fix(tab): give a collapsed pane's row back to the viewport after a relayout

A relayout solves with the collapsed panes taking part, and the layout
offsets the viewport while they are still there. Collapsing them again
afterwards handed their rows back to the panes around them, but not to the
viewport, so a collapsed bar went on holding its row out of it until the
next resize. Fullscreen reads the viewport, so it would not cover that row
either.

Offset the viewport again once the collapsed panes are gone, the same as
resize_whole_tab already does.

* refactor(tiled-panes): keep the hidden pane bookkeeping in PanesToHide

Fullscreen and collapse both hide tiled panes, and each needs to undo only
what it hid. Until now that was done by keeping collapsed panes in a set of
their own and rebuilding panes_to_hide from both sources whenever either
changed, which every caller had to remember to do.

panes_to_hide is now a PanesToHide struct that tracks the two reasons
separately: panes beneath a fullscreen pane, and covered panes such as a
plugin that collapsed itself. set_fullscreen and unset_fullscreen only
touch the first, set_covered and unset_covered only the second, so a
covered pane stays hidden across a fullscreen without any rebuilding, and
the fullscreen pane itself is never hidden.

add_to_hidden_panels and remove_from_hidden_panels had no callers and
wrote straight into the set, so they are gone.

* fix(plugin-api): collapse the slot being rendered for a shared plugin

set_self_collapsed sent env.plugin_id, which for a shared plugin is the
instance and not any of its panes, so a shared plugin such as the bundled
bars could not collapse at all. Resolve the pane through self_pane_id like
the other self commands do, and list SetSelfCollapsed in is_self_command so
a shared plugin can only use it while a slot is current.

* feat(plugin-api): let a shared plugin collapse a slot by id

The other self commands have a slot form that names the pane outright, so
a shared plugin can use them from update or pipe, where no slot is current
and the self form is refused. set_collapsed_slot does the same for
set_self_collapsed, with the ownership check and response the other slot
commands give.

* fix: resurrection, covering selectable panes, mouse clicks, closing, paneinfo

* rebuild assets

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-06 13:23:29 +02:00
Lucca HuguetandAram Drevekenin 7554d23b03 fix: preserve relative pane order when reapplying tiled layouts (#5687)
* fix: preserve relative pane order when reapplying tiled layouts

* fix: cli action timeout

* fix flaky test

* rustfmt

* add pr

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-10-06 11:18:06 +02:00
Aram Drevekenin 201c1593da Interactive configuration, popups, notifications, right-click menu (#5685)
* 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
2026-10-05 18:46:12 +02:00
Aram Drevekenin 1dbc292398 fix: screen surface stability (#5683)
* fix: tiled panes stability

* fix floating panes stability

* additional general fixes

* add pr
2026-10-05 16:47:26 +02:00
Myah Mitchell b1d228f55a fix(screen): keep sending events to suppressed plugin panes (#5680)
* fix(screen): keep sending events to suppressed plugin panes

A plugin that hides itself (hide_self, hide_pane_with_id or hide_slot)
moves into the tab's suppressed panes. Event delivery only looked at the
tiled and floating panes, so a hidden plugin stopped receiving ModeUpdate,
TabUpdate, PaneUpdate and InputReceived, and could never learn that it
should show itself again.

Include suppressed plugin panes when updating input modes and when picking
the plugins for a broadcast event. Render targeting and the client visible
plugins report still use get_plugin_ids, so a suppressed plugin is not
rendered.

* docs(changelog): note suppressed plugins receiving events
2026-10-05 11:15:45 +02:00
Aram Drevekenin 0dac1906ad fix: do not redraw on read-only actions (#5682) 2026-10-05 10:02:47 +02:00
ZykinoandZykino 66e6676698 Reduce a bit some code length and improve readability (#5681)
Co-authored-by: Zykino <3809938+Zykino@users.noreply.github.com>
2026-10-04 23:42:10 +02:00
GhostCoder6969andGhostCoder6969 4ba55d7248 Fix duplicated words in tips and plugin comment (#5677)
* Fix duplicated words in tips and a comment

* Use color_substring helpers for the Ctrl o tip

* Use substring helpers for the remaining tip highlights

---------

Co-authored-by: GhostCoder6969 <ghostcoder6969@users.noreply.github.com>
2026-10-04 18:40:05 +02:00
ZykinoandZykino ef497e1ae3 NestedListItem::new require Text instead of &str (#5611)
Part of the change was done with `ast-grep run -p 'Text::new($A)' -r 'Text::from($A)' --update-all`

Co-authored-by: Zykino <3809938+Zykino@users.noreply.github.com>
2026-09-30 19:26:19 +02:00
Aram Drevekenin a79e15e178 Tiled panes hardening (#5663)
* fix: stacked resize correctness

* additional hardening

* fix flaky integration tests
2026-09-28 16:56:41 +02:00
JackGrenceandAram Drevekenin f39617a4db fix: preserve display width when erasing wide characters (CJK) (#5657)
* fix: preserve display width when erasing wide characters

Calculate end-of-line padding from the retained row's display width instead of character indices, ensuring erased wide characters are replaced with enough spaces to cover all their screen columns.

Add regression coverage for wide characters, including erasing from the second half of a character.

* some additional correctness fixes

* rustfmt

* add pr

* fix flaky test

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-09-28 15:26:22 +02:00
Aram Drevekenin 208a0da5e9 Resource usage optimizations (#5662)
* shared instance plugins

* reduce needless allocations and share memory

* fix: read buffer bug

* idle plugin fixes and optimizations

* trim allocator for glibc on pane close

* fix flaky integration tests

* refactor: naming

* rustfmt

* add pr
2026-09-28 10:58:12 +02:00
Thibault SaunierandAram Drevekenin fc400dfef9 feat(web): add WebSocket heartbeat to prevent false disconnections (#4633)
* feat(web): add WebSocket heartbeat to prevent false disconnections

Idle WebSocket connections are often silently closed by network
intermediaries (e.g. Cloudflare's 100s idle timeout), causing false
"connection lost" messages even though the session is still alive.

Keep the control WebSocket alive by sending a protocol-level Ping
every 30s and closing the connection if no Pong is received within
45s. Browsers reply to Pings automatically below the JS layer, so
this keep-alive survives JS event-loop blocks and tab throttling.

* add some cleanups

* rustfmt

* add pr

---------

Co-authored-by: Aram Drevekenin <aram@poor.dev>
2026-09-25 13:45:16 +02:00
Aram Drevekenin 53051a1a32 fix: resize state and correctness (#5656)
* fix: resize state and correctness

* rustfmt

* add pr
2026-09-25 11:39:39 +02:00
Tyler KellerandAram Drevekenin 2fce032cce fix(kitty-graphics): zlib-compress images forwarded to the host terminal (#5608)
* 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 <aram@poor.dev>
2026-09-25 10:33:28 +02:00
Aram Drevekenin 3e470a43dc fix: stop host terminal replies from leaking into the shell prompt (#5655)
* fix: stop host terminal replies from leaking into the shell prompt as text

* add pr
2026-09-24 18:52:13 +02:00
Aram Drevekenin 34e75e991f fix: do the right thing when multiple plugin panes exist on the edge (#5653)
* fix: do the right thing when multiple plugin panes exist on the edge

* fix: only strip the first layer

* add pr
2026-09-24 16:28:03 +02:00
Myah MitchellandAram Drevekenin 0591ca5432 feat(nested-sessions): report a guest's input mode and key bindings to its host (#5589)
* 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 <aram@poor.dev>
2026-09-24 14:43:03 +02:00
Aram DrevekeninandLucca Huguet 81f56e1aed Yazelix fixes (sixel/kitty correctness, explicit-swap-layout change rather than toggle, border styling) (#5630)
* fix: sixel image reaping/id-reuse

* fix: kitty scaling issues

* fix: stacked pane ordering

* feat: apply tiled/floating swap layout by name

* border styling

* fix tests

* fix: complete Yazelix feature validation (#5631)

* fix: retire client-ids instead of reusing them

* distributions

* rustfmt

* fix tests

* update changelog

* fix tests and race

---------

Co-authored-by: Lucca Huguet <lucca.huguet2@gmail.com>
2026-09-24 09:26:20 +02:00
Thomas Linford f19b2ce822 fix(plugins): don't copy embedded plugin assets onto the heap (#5622)
ASSET_MAP stored the builtin plugins as include_bytes!(..).to_vec(), so the first access copied all of them (~17.6 MiB) onto the heap for the lifetime of the server. This stores &'static [u8] instead.

Server with one pane and one client on macOS: 45 MB -> 28 MB.
2026-09-23 13:15:36 +02:00
wormuz fa131c8b4a fix(cli): add recv timeout in assert_socket so zellij ls doesn't hang on a wedged server (#5481) 2026-09-22 11:39:37 +02:00