Allow resizing docks

Docks can now be resized in whole cells by dragging their inner border,
with the resize_window action and with kitten @ resize-window, where
wider or taller always means bigger whatever the edge of the dock. A
dock keeps at least one cell and grows only into the content it is
docked to, so the docks inside it are never shrunk. OS window docks do
not shrink the tab docks of any tab, and when dragged, the other tabs
are re-laid out once, at the end of the drag. Percentage sizes stay
percentages. The new size is stored in the DockSpec, so it is reported
by kitten @ ls and saved in sessions. Resetting window sizes does not
change docks, as they are not part of the layout.

Previously the inner border of a dock showed a resize pointer but
dragging it did nothing, or in the Tall layout moved a layout divider.

Fixes #10857
This commit is contained in:
Kovid Goyal 2026-11-13 13:13:16 +05:30
parent 3fe8677c4d
commit 11cbfdce23
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C
9 changed files with 328 additions and 7 deletions

View file

@ -129,6 +129,10 @@ Detailed list of changes
with :code:`launch --type=os-window-dock`. The dock is shown in every tab of
the OS window, see :ref:`docks` (:iss:`10854`)
- Allow resizing docks by dragging their inner border or with the
:ac:`resize_window` action and :code:`kitten @ resize-window`, see :ref:`docks`
(:iss:`10857`)
- :doc:`Custom shaders <custom-shaders>`: Add ``screen-shake`` shaders that shake
a window on bell and new events and uniforms for command start/finish and
alternate screen enter/exit

View file

@ -329,6 +329,15 @@ percentage of the window, tab or OS window being docked to. When there are sever
at an edge, later docks are placed inside earlier ones. When there is not
enough space for all the docks, the docks created last are made smaller first.
Docks can be resized in whole cells by dragging their inner border with the
mouse, or with the :ac:`resize_window` action and :ref:`kitten @ resize-window
<at-resize-window>`, where wider or taller always means bigger, whatever the
edge of the dock. Only the size along the axis of the dock can be changed. A
size that was a percentage stays a percentage. The new size is used from then
on, including in :ref:`kitten @ ls <at-ls>` and in saved sessions. Resetting
window sizes does not change the size of docks, as they are not part of the
layout.
A :code:`window-dock` belongs to the window it is docked to. It is shown
whenever that window is shown, moves with it when it is moved to another tab
and is closed when it is closed. A :code:`tab-dock` is closed when the last