Kill attached session (tmux) #157
Muizzyranking
started this conversation in
Show and tell
Replies: 1 comment
-
|
Thanks, base on yours, I got my version that can kill one of started sessions, including detached: ---@param opts? { filter?: sidekick.cli.Filter }
local function sidekick_cli_kill(opts)
local Cli = require("sidekick.cli")
local State = require("sidekick.cli.state")
local Util = require("sidekick.util")
---@param state sidekick.cli.State
local function kill(state)
if not state then
return
end
State.detach(state)
if state.session and state.session.mux_session then
if state.session.backend == "tmux" or state.session.mux_backend == "tmux" then
Util.exec({ "tmux", "kill-session", "-t", state.session.mux_session })
end
end
end
opts = opts or {}
Cli.select({
auto = true,
filter = Util.merge(opts.filter, { started = true }),
cb = kill,
})
end
return {
{
"folke/sidekick.nvim",
optional = true,
keys = {
{ "<leader>ak", sidekick_cli_kill, desc = "Kill (Sidekick)" },
},
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Closing or detaching CLI tool does not kill the session. If you are using tmux as mux backend, the session persists and you would have to kill that session manually. This keybind will the kill the attached session
Beta Was this translation helpful? Give feedback.
All reactions