Skip to content

fix(cli): route focus() to session for external tmux sessions#303

Open
arbrandes wants to merge 1 commit intofolke:mainfrom
arbrandes:split-focus
Open

fix(cli): route focus() to session for external tmux sessions#303
arbrandes wants to merge 1 commit intofolke:mainfrom
arbrandes:split-focus

Conversation

@arbrandes
Copy link
Copy Markdown

Description

PR #198 made external tmux panes receive focus when attaching via select/show/send, but the dedicated focus keymap (require("sidekick.cli").focus(), commonly bound to <C-.>) still didn't work for external tmux sessions.

This change adds an external-session branch at the top of the M.focus callback that calls session:focus() directly, so pressing the focus keymap on an attached external tmux session runs tmux select-pane on the sidekick pane as expected.

@github-actions github-actions Bot added the size/s Small PR (<10 lines changed) label Apr 19, 2026
`require("sidekick.cli").focus()` short-circuited on `not state.terminal`,
so external tmux sessions (created with `mux.create = "split"` or
`"window"`) never received focus when the keymap fired. Call
`session:focus()` in that branch so the sidekick pane is selected via
`tmux select-pane`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s Small PR (<10 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant