Skip to content

bug: focus is not appplied with tmux pane #179

@noirbizarre

Description

@noirbizarre

Did you check docs and existing issues?

  • I have read all the sidekick.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of sidekick.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

0.11.4

Operating system/version

Archlinux

Describe the bug

When using sidekick.cli.toggle({ focus = true }) or sidekick.cli.focus(), the focus is not given to the tmux cli pane (Opencode in my case).

Sidekick is configured with:

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

Steps To Reproduce

  1. Use tmux cli backend with create = "split" option
  2. Execute require("sidekick.cli").toggle({ name = "opencode", focus = true }) -> Opencode opens in a new pane but is not focused
  3. Execute require("sidekick.cli").focus() -> the pane is still not focused.

Expected Behavior

tmux pane containing the CLI is focused when using toggle() and focus()

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
	spec = {
		{
			"folke/sidekick.nvim",
			opts = {
				cli = {
					mux = {
						backend = "tmux",
						enabled = true,
						create = "split",
					},
				},
			},
			keys = {
				{
					"<c-.>",
					function()
						require("sidekick.cli").focus()
					end,
					mode = { "n", "x", "i", "t" },
					desc = "Sidekick Switch Focus",
				},
				{
					"<leader>aa",
					function()
						require("sidekick.cli").toggle({ focus = true })
					end,
					desc = "Sidekick Toggle CLI",
					mode = { "n", "v" },
				},
			},
		},
	},
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a while

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions