From 7b82a4028d686fa2388a2ac6892926633d9663c0 Mon Sep 17 00:00:00 2001 From: "Adolfo R. Brandes" Date: Sun, 19 Apr 2026 07:54:01 -0300 Subject: [PATCH] fix(cli): route focus() to session for external tmux sessions `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`. --- lua/sidekick/cli/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/sidekick/cli/init.lua b/lua/sidekick/cli/init.lua index 9c0e9b50..6131adf8 100644 --- a/lua/sidekick/cli/init.lua +++ b/lua/sidekick/cli/init.lua @@ -121,6 +121,10 @@ end function M.focus(opts) opts = filter_opts(opts) State.with(function(state) + if state.external and state.session and state.session.focus then + state.session:focus() + return + end if not state.terminal then return end