Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions lua/wiremux/backend/tmux/action.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,16 @@ function M.resize_pane_zoom(pane_id)
return cmd
end

---@param direction "horizontal"|"vertical"
---@param size string
---@param pane_id? string
---@return string[]
function M.resize_pane(direction, size, pane_id)
local cmd = { "resize-pane", direction == "horizontal" and "-x" or "-y", size }
if pane_id then
vim.list_extend(cmd, { "-t", pane_id })
end
return cmd
end

return M
7 changes: 6 additions & 1 deletion lua/wiremux/backend/tmux/operation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,15 @@ function M.create(target_name, def, st)
table.insert(cmds, action.new_window(window_name, not use_shell and cmd or nil))
table.insert(cmds, query.window_id())
else
local split = def.split or "horizontal"
table.insert(
cmds,
action.split_pane(def.split or "horizontal", st.origin_pane_id, not use_shell and cmd or nil)
action.split_pane(split, st.origin_pane_id, not use_shell and cmd or nil)
)
local size = def.size
if size then
table.insert(cmds, action.resize_pane(split, def.size))
end
table.insert(cmds, query.pane_id())
end

Expand Down
1 change: 1 addition & 0 deletions lua/wiremux/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ local M = {}
---@field shell? boolean Run command through shell (default: true)
---@field label? string|fun(inst: wiremux.Instance, index: number): string Custom display label for picker
---@field title? string Custom tmux window / zellij tab name
---@field size? string Custom tmux pane size
---@field startup_timeout? number Max milliseconds to wait for TUI to render before sending (default: 3500)

local defaults = {
Expand Down