Skip to content
Open
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
8 changes: 8 additions & 0 deletions lua/sidekick/cli/session/tmux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,14 @@ function M:submit()
Util.exec({ "tmux", "send-keys", "-t", self.tmux_pane_id, "Enter" })
end

---Focus the tmux pane (select it as the active pane)
function M:focus()
local pane_id = self:pane_id()
if pane_id then
Util.exec({ "tmux", "select-pane", "-t", pane_id })
end
end

function M:dump()
local pane_id = self:pane_id()
if not pane_id then
Expand Down
2 changes: 2 additions & 0 deletions lua/sidekick/cli/state.lua
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ function M.attach(state, opts)
terminal:focus()
end
end
elseif state.session and state.session.focus and opts.focus ~= false then
state.session:focus()
elseif attached then
Util.info("Attached to `" .. state.tool.name .. "`")
end
Expand Down