@@ -153,23 +153,31 @@ def set_window_option(self, option, value):
153
153
process .stderr
154
154
)
155
155
156
- def show_window_options (self , option = None ):
156
+ def show_window_options (self , option = None , g = False ):
157
157
"""Return a dict of options for the window.
158
158
159
159
For familiarity with tmux, the option ``option`` param forwards to pick
160
160
a single option, forwarding to :meth:`Window.show_window_option`.
161
161
162
162
:param option: optional. show a single option.
163
163
:type option: string
164
+ :param g: Pass ``-g`` flag for global variable
165
+ :type g: bool
164
166
:rtype: :py:obj:`dict`
165
167
166
168
"""
167
169
170
+ tmux_args = tuple ()
171
+
172
+ if g :
173
+ tmux_args += ('-g' ,)
174
+
168
175
if option :
169
- return self .show_window_option (option )
176
+ return self .show_window_option (option , g = g )
170
177
else :
178
+ tmux_args += ('show-window-options' ,)
171
179
window_options = self .tmux (
172
- 'show-window-options'
180
+ * tmux_args
173
181
).stdout
174
182
175
183
window_options = [tuple (item .split (' ' )) for item in window_options ]
@@ -182,19 +190,28 @@ def show_window_options(self, option=None):
182
190
183
191
return window_options
184
192
185
- def show_window_option (self , option ):
193
+ def show_window_option (self , option , g = False ):
186
194
"""Return a list of options for the window.
187
195
188
196
todo: test and return True/False for on/off string
189
197
190
198
:param option: option to return.
191
199
:type option: string
200
+ :param g: Pass ``-g`` flag, global.
201
+ :type g: bool
192
202
:rtype: string, int
193
203
194
204
"""
195
205
206
+ tmux_args = tuple ()
207
+
208
+ if g :
209
+ tmux_args += ('-g' ,)
210
+
211
+ tmux_args += (option ,)
212
+
196
213
window_option = self .tmux (
197
- 'show-window-options' , option
214
+ 'show-window-options' , * tmux_args
198
215
).stdout
199
216
200
217
if window_option :
0 commit comments