tmux-python / tmux-python/libtmux

select_pane not working correctly with multiple sessions

Open
#487 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.2k
Forks
127
Avg merge
2h 13m
Merged PRs (30d)
1

Description

The code of select_pane is:

        if target_pane in ["-l", "-U", "-D", "-L", "-R"]:
            proc = self.cmd("select-pane", "-t%s" % self.window_id, target_pane)
        else:
            proc = self.cmd("select-pane", "-t%s" % target_pane)

If calling it with a pane index (e.g. window.select_pane(3)) the resulting command will be select-pane -t3. This will result in self.server.cmd('select-pane -t3').

=> It will always change the pane in the session number 1.

Shouldn't there be some kind of further target description like
select-pane -t $3:@9.3 (change to pane 3 in session 3, window9)
?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the select_pane implementation shown in the issue and trace how self.cmd passes its target to self.server.cmd. Reproduce window.select_pane(3) with multiple sessions, then verify that the generated target retains the session and window context and selects pane 3 in the requested session.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.