fix active pane retrieval when passing a format as target

This commit is contained in:
Jorge Morante 2025-05-18 15:11:28 +02:00
parent e5d8f3ce42
commit 963ca74c9e
2 changed files with 9 additions and 3 deletions

View file

@ -167,7 +167,7 @@ module Fingers::Commands
@active_pane = target_pane
else
@pane_id = tmux.exec("display-message -t #{pane_target_format} -p '\#{pane_id}'").chomp
@active_pane = tmux.list_panes("\#{pane_active}").first
@active_pane = tmux.list_panes("\#{pane_active}", target_pane.window_id).first
end
end

View file

@ -134,8 +134,14 @@ class Tmux
@version = Tmux.tmux_version_to_semver(version_string)
end
def list_panes(filters = "") : Array(Pane)
args = ["list-panes", "-a", "-F", PANE_FORMAT]
def list_panes(filters = "", target = nil) : Array(Pane)
args = ["list-panes", "-F", PANE_FORMAT]
if target.nil?
args << "-a"
else
args.concat(["-t", target])
end
if !filters.empty?
args.concat(["-f", filters])