Teach toggle-fullscreen a second mode, 'exit', that only performs the
un-fullscreen branch and never breaks a pane out. Bind Option+Escape
(M-Escape) to that mode so the key is a pure "leave fullscreen if
you're in one" — no-op on a pane that isn't currently fullscreened, no
risk of surprising the user into fullscreen. Both keys also now call
smart-layout on the pane's newly-joined window after join-pane, so
returning a pane to a two-pane layout reshapes into whichever tiling
best fits the window shape.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Option+O used to cycle tmux's built-in layouts. It now runs a smart-layout
script that scores even-horizontal, even-vertical, and tiled by how close
each one puts the per-pane aspect to a 2:1 cell target (roughly square in
pixels) and applies the winner. A wide window with four panes becomes a
single horizontal row instead of a squished 2x2; a tall narrow window
becomes a vertical stack. The old layout-cycling behavior is preserved on
Option+P for anyone who wants to hand-pick.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Break-pane puts the focused pane into a new window by itself; pressing
Option+F again rejoins it to the layout it came from. Origin window id
is stashed on the pane as the @orig-window user option, so it persists
through break-pane/join-pane without any session-level bookkeeping. If
the origin window no longer exists, the stash is cleared and the pane
stays put. Solo-pane windows are a no-op so no dangling state ever
gets written.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>