Skip to content

Commit 4a0aa07

Browse files
authored
Merge pull request #271 from Flowdalic/fix-select-window
Fix select_window() by providing the session ID as argument to -t
2 parents 9752999 + af94b48 commit 4a0aa07

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Python 2.7 support dropped.
1717
- :issue:`312`: ci: Add tmux 3.2a to CI
1818
- chore: Update black to `21.6b0
1919
<https://github.com/psf/black/blob/21.6b0/CHANGES.md#216b0>`_
20+
- :issue:`271`: Fix select_window() by providing the session ID as
21+
argument to -t.
2022

2123
libtmux 0.8.5 (2020-10-25)
2224
--------------------------

libtmux/session.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,10 @@ def select_window(self, target_window):
353353
assure ``-l``, ``-n``, ``-p`` work.
354354
"""
355355

356-
target = '-t%s' % target_window
356+
# Note that we also provide the session ID here, since cmd()
357+
# will not automatically add it as there is already a '-t'
358+
# argument provided.
359+
target = '-t%s:%s' % (self._session_id, target_window)
357360

358361
proc = self.cmd('select-window', target)
359362

0 commit comments

Comments
 (0)