feat(wezterm): add Alt+Delete to focus master pane
Implements spatial "master pane" focusing that mirrors XMonad's master window concept. Alt+Delete now focuses the largest pane in the current tab, completing the unified Delete key semantic across all tools: - Gui+Delete (XMonad): Focus master window (largest in layout) - Alt+Delete (WezTerm): Focus master pane (largest, ties to lowest index) - Delete (Neovim): Center cursor view The implementation is spatially-aware rather than content-aware, maintaining the navigation layer's positional abstraction. When panes are equal-sized, the lowest-indexed pane is chosen for predictability.
This commit is contained in:
parent
3fe607d310
commit
9971d2d2a5
1 changed files with 23 additions and 0 deletions
|
|
@ -150,6 +150,29 @@ config.keys = {
|
||||||
action = wezterm.action.RotatePanes("Clockwise"),
|
action = wezterm.action.RotatePanes("Clockwise"),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ -- Focus largest (master) pane
|
||||||
|
key = "Delete",
|
||||||
|
mods = "ALT",
|
||||||
|
action = wezterm.action_callback(function(window, pane)
|
||||||
|
local tab = window:active_tab()
|
||||||
|
local largest = nil
|
||||||
|
local largest_size = 0
|
||||||
|
|
||||||
|
for _, p in ipairs(tab:panes()) do
|
||||||
|
local dims = p:get_dimensions()
|
||||||
|
local size = dims.pixel_width * dims.pixel_height
|
||||||
|
if size > largest_size then
|
||||||
|
largest_size = size
|
||||||
|
largest = p
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if largest and largest:pane_id() ~= pane:pane_id() then
|
||||||
|
largest:activate()
|
||||||
|
end
|
||||||
|
end),
|
||||||
|
},
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Copy / Paste
|
-- Copy / Paste
|
||||||
--
|
--
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue