Arrange panes and resize windows
Needs libtmux for PowerShell 0.x Install
Select $window and $pane with Get-TmuxWindow and Get-TmuxPane. Layout
and size changes support -WhatIf and -Confirm. They emit nothing on success;
with -PassThru they return a replacement handle, and earlier captured objects
stay as they were.
Give a window explicit dimensions in cells:
$window | Set-TmuxWindowSize -Width 120 -Height 40 -PassThruAt least one dimension is required. Resizing sets window-size to manual, so
the window stops following its clients. The alternatives are mutually exclusive:
-Direction Right -Adjustment 5grows an edge.-Mode ExpandorShrinkuses the largest or smallest attached client.
Arrange existing panes side by side:
$window | Set-TmuxLayout -Layout 'even-horizontal' -PassThru- Presets:
even-vertical,main-horizontal,main-verticalandtiledalso work. Unambiguous prefixes are accepted; unknown or ambiguous names fail before dispatch. - Modes:
-Mode Next,PreviousorSpreadreplaces-Layoutto cycle layouts or spread panes. - Restore: pass a captured
$window.Layoutback as-Layout. On tmux 3.7 and earlier the sizes come back but panes can rotate between positions. - JSON layout: needs tmux 3.8; see compatibility.
Set a pane’s width in a window with a horizontal split:
$pane | Set-TmuxPaneSize -Width '40' -PassThruDimensions also accept percentages such as '50%'. tmux clamps sizes that do
not fit, so read the replacement handle for the result. -Direction with
-Adjustment moves a pane edge instead.
Toggle a pane’s zoom:
$pane | Set-TmuxPaneSize -ZoomRepeating the command turns zoom off. -Zoom cannot combine with a size or
direction. A stale or missing target writes a per-target error, and
-ErrorAction Stop ends the pipeline. Cancellation does not roll back a change
already sent.