@@ -386,7 +386,7 @@ def show_hook(
386386 def get_hook_indices (
387387 self ,
388388 hook : str ,
389- _global : bool = False ,
389+ global_ : bool = False ,
390390 scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ,
391391 ignore_errors : bool | None = None ,
392392 ) -> list [int ]:
@@ -396,7 +396,7 @@ def get_hook_indices(
396396 ----------
397397 hook : str
398398 Hook name, e.g. 'session-renamed'
399- _global : bool
399+ global_ : bool
400400 Use global hooks
401401 scope : OptionScope | None
402402 Scope for the hook
@@ -424,7 +424,7 @@ def get_hook_indices(
424424 """
425425 hooks_output = self ._show_hook (
426426 hook = hook ,
427- _global = _global ,
427+ global_ = global_ ,
428428 scope = scope ,
429429 ignore_errors = ignore_errors ,
430430 )
@@ -439,7 +439,7 @@ def get_hook_indices(
439439 def get_hook_values (
440440 self ,
441441 hook : str ,
442- _global : bool = False ,
442+ global_ : bool = False ,
443443 scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ,
444444 ignore_errors : bool | None = None ,
445445 ) -> SparseArray [str ]:
@@ -449,7 +449,7 @@ def get_hook_values(
449449 ----------
450450 hook : str
451451 Hook name, e.g. 'session-renamed'
452- _global : bool
452+ global_ : bool
453453 Use global hooks
454454 scope : OptionScope | None
455455 Scope for the hook
@@ -478,7 +478,7 @@ def get_hook_values(
478478 """
479479 hooks_output = self ._show_hook (
480480 hook = hook ,
481- _global = _global ,
481+ global_ = global_ ,
482482 scope = scope ,
483483 ignore_errors = ignore_errors ,
484484 )
@@ -498,7 +498,7 @@ def set_hooks_bulk(
498498 values : HookValues ,
499499 * ,
500500 clear_existing : bool = False ,
501- _global : bool | None = None ,
501+ global_ : bool | None = None ,
502502 scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ,
503503 ) -> Self :
504504 """Set multiple indexed hooks at once.
@@ -514,7 +514,7 @@ def set_hooks_bulk(
514514 - list[str]: ['cmd1', 'cmd2'] - sequential indices starting at 0
515515 clear_existing : bool
516516 If True, unset all existing hook values first
517- _global : bool | None
517+ global_ : bool | None
518518 Use global hooks
519519 scope : OptionScope | None
520520 Scope for the hook
@@ -564,7 +564,7 @@ def set_hooks_bulk(
564564 Session($...)
565565 """
566566 if clear_existing :
567- self .clear_hook (hook , _global = _global , scope = scope )
567+ self .clear_hook (hook , global_ = global_ , scope = scope )
568568
569569 # Convert list to dict with sequential indices
570570 if isinstance (values , list ):
@@ -574,7 +574,7 @@ def set_hooks_bulk(
574574 self .set_hook (
575575 f"{ hook } [{ index } ]" ,
576576 value ,
577- _global = _global ,
577+ global_ = global_ ,
578578 scope = scope ,
579579 )
580580
@@ -583,7 +583,7 @@ def set_hooks_bulk(
583583 def clear_hook (
584584 self ,
585585 hook : str ,
586- _global : bool | None = None ,
586+ global_ : bool | None = None ,
587587 scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ,
588588 ignore_errors : bool | None = None ,
589589 ) -> Self :
@@ -593,7 +593,7 @@ def clear_hook(
593593 ----------
594594 hook : str
595595 Hook name, e.g. 'session-renamed'
596- _global : bool | None
596+ global_ : bool | None
597597 Use global hooks
598598 scope : OptionScope | None
599599 Scope for the hook
@@ -624,14 +624,14 @@ def clear_hook(
624624 """
625625 indices = self .get_hook_indices (
626626 hook ,
627- _global = _global if _global is not None else False ,
627+ global_ = global_ if global_ is not None else False ,
628628 scope = scope ,
629629 ignore_errors = ignore_errors ,
630630 )
631631 for index in indices :
632632 self .unset_hook (
633633 f"{ hook } [{ index } ]" ,
634- _global = _global ,
634+ global_ = global_ ,
635635 scope = scope ,
636636 ignore_errors = ignore_errors ,
637637 )
@@ -641,7 +641,7 @@ def append_hook(
641641 self ,
642642 hook : str ,
643643 value : str ,
644- _global : bool | None = None ,
644+ global_ : bool | None = None ,
645645 scope : OptionScope | _DefaultOptionScope | None = DEFAULT_OPTION_SCOPE ,
646646 ) -> Self :
647647 """Append a hook value at the next available index.
@@ -652,7 +652,7 @@ def append_hook(
652652 Hook name, e.g. 'session-renamed'
653653 value : str
654654 Hook command to append
655- _global : bool | None
655+ global_ : bool | None
656656 Use global hooks
657657 scope : OptionScope | None
658658 Scope for the hook
@@ -678,14 +678,14 @@ def append_hook(
678678 """
679679 indices = self .get_hook_indices (
680680 hook ,
681- _global = _global if _global is not None else False ,
681+ global_ = global_ if global_ is not None else False ,
682682 scope = scope ,
683683 )
684684 next_index = max (indices ) + 1 if indices else 0
685685 self .set_hook (
686686 f"{ hook } [{ next_index } ]" ,
687687 value ,
688- _global = _global ,
688+ global_ = global_ ,
689689 scope = scope ,
690690 )
691691 return self
0 commit comments