diff --git a/internal/action/command.go b/internal/action/command.go index 872e9397..9bf979b9 100644 --- a/internal/action/command.go +++ b/internal/action/command.go @@ -1073,8 +1073,8 @@ func (h *BufPane) openTerm(args []string, newtab bool) { h.AddTab() id = MainTab().Panes[pane].ID() } else { - for i, p := range h.tab.Panes { - if p.ID() == h.ID() { + for i, p := range MainTab().Panes { + if p.IsActive() { pane = i id = p.ID() p.Close()