Skip to content

Conversation

@piersolenski
Copy link

@piersolenski piersolenski commented Nov 15, 2025

Description

Fixes #179

When using tmux with create = "split" or create = "window", the focus option was not being applied because external tmux sessions don't have a Neovim terminal window. The existing focus logic only worked for terminal-based sessions.

Manual Testing

With the following configuration:

cli = {
  mux = {
    backend = "tmux",
    enabled = true,
    create = "split",
  },
}

Running require("sidekick.cli").toggle({ name = "opencode", focus = true }) or require("sidekick.cli").focus() now correctly focuses the tmux pane.

When using tmux with `create = "split"` or `create = "window"`, the
`focus` option was not being applied because external sessions don't
have a Neovim terminal window.

This commit:
- Adds a `focus()` method to the base Session class
- Implements `focus()` for tmux backend using `tmux select-pane`
- Calls `session:focus()` in state.lua when session is external

Fixes folke#179

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the size/m Medium PR (<50 lines changed) label Nov 15, 2025
Co-authored-by: Anant Thazhemadam <47104651+thazhemadam@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: focus is not appplied with tmux pane

2 participants