@@ -436,7 +436,18 @@ def select_layout(self, layout: str | None = None) -> Window:
436
436
437
437
return self
438
438
439
- def set_window_option (self , option : str , value : int | str ) -> Window :
439
+ def set_window_option (
440
+ self ,
441
+ option : str ,
442
+ value : int | str ,
443
+ format : bool | None = None ,
444
+ unset : bool | None = None ,
445
+ unset_panes : bool | None = None ,
446
+ prevent_overwrite : bool | None = None ,
447
+ suppress_warnings : bool | None = None ,
448
+ append : bool | None = None ,
449
+ g : bool | None = None ,
450
+ ) -> Window :
440
451
"""Set option for tmux window.
441
452
442
453
Wraps ``$ tmux set-window-option <option> <value>``.
@@ -454,15 +465,45 @@ def set_window_option(self, option: str, value: int | str) -> Window:
454
465
:exc:`exc.OptionError`, :exc:`exc.UnknownOption`,
455
466
:exc:`exc.InvalidOption`, :exc:`exc.AmbiguousOption`
456
467
"""
468
+ flags : list [str ] = []
457
469
if isinstance (value , bool ) and value :
458
470
value = "on"
459
471
elif isinstance (value , bool ) and not value :
460
472
value = "off"
461
473
474
+ if unset is not None and unset :
475
+ assert isinstance (unset , bool )
476
+ flags .append ("-u" )
477
+
478
+ if unset_panes is not None and unset_panes :
479
+ assert isinstance (unset_panes , bool )
480
+ flags .append ("-U" )
481
+
482
+ if format is not None and format :
483
+ assert isinstance (format , bool )
484
+ flags .append ("-F" )
485
+
486
+ if prevent_overwrite is not None and prevent_overwrite :
487
+ assert isinstance (prevent_overwrite , bool )
488
+ flags .append ("-o" )
489
+
490
+ if suppress_warnings is not None and suppress_warnings :
491
+ assert isinstance (suppress_warnings , bool )
492
+ flags .append ("-q" )
493
+
494
+ if append is not None and append :
495
+ assert isinstance (append , bool )
496
+ flags .append ("-a" )
497
+
498
+ if g is not None and g :
499
+ assert isinstance (g , bool )
500
+ flags .append ("-g" )
501
+
462
502
cmd = self .cmd (
463
503
"set-window-option" ,
464
504
option ,
465
505
value ,
506
+ * flags ,
466
507
)
467
508
468
509
if isinstance (cmd .stderr , list ) and len (cmd .stderr ):
0 commit comments