Skip to content

Commit a93d0fe

Browse files
committed
HooksMixin(fix[show_hook]): Strip % prefix for control-mode hooks
why: Control-mode hooks like %output, %window-add have % prefix that Hooks.from_stdout() strips when creating attributes, but show_hook() didn't strip it before lookup, causing all %-prefixed hooks to return None. what: - Add lstrip("%") before replace("-", "_") in show_hook() attribute lookup
1 parent e4722dc commit a93d0fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libtmux/hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def show_hook(
432432
if hooks_output is None:
433433
return None
434434
hooks = Hooks.from_stdout(hooks_output)
435-
return getattr(hooks, hook.replace("-", "_"), None)
435+
return getattr(hooks, hook.lstrip("%").replace("-", "_"), None)
436436

437437
def set_hooks(
438438
self,

0 commit comments

Comments
 (0)