@@ -77,7 +77,7 @@ def set_option(
77
77
suppress_warnings : t .Optional [bool ] = None ,
78
78
append : t .Optional [bool ] = None ,
79
79
g : t .Optional [bool ] = None ,
80
- scope : t .Optional [t .Union [OptionScope , _DefaultScope ]] = None ,
80
+ scope : t .Optional [t .Union [OptionScope , _DefaultScope ]] = DEFAULT_SCOPE ,
81
81
) -> "t.Self" :
82
82
"""Set option for tmux window.
83
83
@@ -155,7 +155,7 @@ def set_option(
155
155
def show_options (
156
156
self ,
157
157
g : t .Optional [bool ],
158
- scope : t .Optional [OptionScope ],
158
+ scope : t .Optional [t . Union [ OptionScope , _DefaultScope ] ],
159
159
include_hooks : t .Optional [bool ],
160
160
include_parents : t .Optional [bool ],
161
161
values_only : t .Literal [True ],
@@ -166,7 +166,7 @@ def show_options(
166
166
def show_options (
167
167
self ,
168
168
g : t .Optional [bool ],
169
- scope : t .Optional [OptionScope ],
169
+ scope : t .Optional [t . Union [ OptionScope , _DefaultScope ] ],
170
170
include_hooks : t .Optional [bool ],
171
171
include_parents : t .Optional [bool ],
172
172
values_only : t .Literal [None ] = None ,
@@ -177,7 +177,7 @@ def show_options(
177
177
def show_options (
178
178
self ,
179
179
g : t .Optional [bool ] = None ,
180
- scope : t .Optional [OptionScope ] = None ,
180
+ scope : t .Optional [t . Union [ OptionScope , _DefaultScope ]] = DEFAULT_SCOPE ,
181
181
include_hooks : t .Optional [bool ] = None ,
182
182
include_parents : t .Optional [bool ] = None ,
183
183
values_only : t .Literal [False ] = False ,
@@ -187,7 +187,7 @@ def show_options(
187
187
def show_options (
188
188
self ,
189
189
g : t .Optional [bool ] = False ,
190
- scope : t .Optional [OptionScope ] = OptionScope . Window ,
190
+ scope : t .Optional [t . Union [ OptionScope , _DefaultScope ]] = DEFAULT_SCOPE ,
191
191
include_hooks : t .Optional [bool ] = None ,
192
192
include_parents : t .Optional [bool ] = None ,
193
193
values_only : t .Optional [bool ] = False ,
@@ -199,12 +199,15 @@ def show_options(
199
199
g : str, optional
200
200
Pass ``-g`` flag for global variable, default False.
201
201
"""
202
+ if scope is DEFAULT_SCOPE :
203
+ scope = self .default_scope
204
+
202
205
tmux_args : t .Tuple [str , ...] = ()
203
206
204
207
if g :
205
208
tmux_args += ("-g" ,)
206
209
207
- if scope is not None :
210
+ if scope is not None and not isinstance ( scope , _DefaultScope ) :
208
211
assert scope in OPTION_SCOPE_FLAG_MAP
209
212
tmux_args += (OPTION_SCOPE_FLAG_MAP [scope ],)
210
213
@@ -243,7 +246,7 @@ def show_option(
243
246
self ,
244
247
option : str ,
245
248
g : bool = False ,
246
- scope : t .Optional [OptionScope ] = OptionScope . Window ,
249
+ scope : t .Optional [t . Union [ OptionScope , _DefaultScope ]] = DEFAULT_SCOPE ,
247
250
include_hooks : t .Optional [bool ] = None ,
248
251
include_parents : t .Optional [bool ] = None ,
249
252
) -> t .Optional [t .Union [str , int ]]:
@@ -262,12 +265,15 @@ def show_option(
262
265
:exc:`exc.OptionError`, :exc:`exc.UnknownOption`,
263
266
:exc:`exc.InvalidOption`, :exc:`exc.AmbiguousOption`
264
267
"""
268
+ if scope is DEFAULT_SCOPE :
269
+ scope = self .default_scope
270
+
265
271
tmux_args : t .Tuple [t .Union [str , int ], ...] = ()
266
272
267
273
if g :
268
274
tmux_args += ("-g" ,)
269
275
270
- if scope is not None :
276
+ if scope is not None and not isinstance ( scope , _DefaultScope ) :
271
277
assert scope in OPTION_SCOPE_FLAG_MAP
272
278
tmux_args += (OPTION_SCOPE_FLAG_MAP [scope ],)
273
279
0 commit comments