From 2b29b87c0a040a1cbbe4d847f7220082cfd209d1 Mon Sep 17 00:00:00 2001 From: Shaw Vrana Date: Tue, 8 Feb 2022 13:20:11 -0800 Subject: [PATCH] Fix tmux gotoTerminal for panes gotoTerminal should work for both the pane and window case. --- lua/harpoon/tmux.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/harpoon/tmux.lua b/lua/harpoon/tmux.lua index 081bedf..134d92f 100644 --- a/lua/harpoon/tmux.lua +++ b/lua/harpoon/tmux.lua @@ -70,7 +70,10 @@ local function find_terminal(args) if type(args) == "string" then -- assume args is a valid tmux target identifier -- if invalid, the error returned by tmux will be thrown - return { window_id = args } + return { + window_id = args, + pane = true, + } end if type(args) == "number" then @@ -118,7 +121,7 @@ function M.gotoTerminal(idx) local _, ret, stderr = utils.get_os_command_output({ "tmux", - "select-window", + window_handle.pane and "select-pane" or "select-window", "-t", window_handle.window_id, }, vim.loop.cwd())