Skip to content

Commit 9d9cd89

Browse files
committed
wierd fix for set-window-option on tmux 1.8
1 parent 0657ab2 commit 9d9cd89

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Here you can find the recent changes to tmuxp.
1717
switch/attach even if no was entered
1818
- [cli] when workspace loader crashes, give option to kill session, attach it or
1919
detach it.
20+
- [cli] tmux 1.8 ``set-option`` / ``set-window-options`` command
21+
``target-window`` fix.
2022

2123
2013-10-28
2224
----------

tmuxp/window.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,19 @@ def set_window_option(self, option, value):
138138

139139
process = self.tmux(
140140
'set-window-option',
141+
'-t%s:%s' % (self.get('session_id'), self.get('window_index')),
141142
option, value
142143
)
143144

145+
# tmuxp set-window-option version 1.8 has a quirk where
146+
# -t@2 window id won't work as ``target-pane``.
147+
144148
if process.stderr:
145149
if isinstance(process.stderr, list) and len(process.stderr) == int(1):
146150
process.stderr = process.stderr[0]
147151
raise ValueError(
148-
'tmux set-window-option stderr: %s' % process.stderr)
152+
'tmux set-window-option -t%s %s %s\n' % (self.get('window_id'), option, value) +
153+
process.stderr)
149154

150155
def show_window_options(self, option=None):
151156
'''

0 commit comments

Comments
 (0)