Skip to content

Commit 9ae32ab

Browse files
committed
hooks(fix): add doctest cleanup for tmux < 3.0 compatibility
why: On tmux 2.6-2.8, unset_hook without index doesn't clear all array entries, causing state leakage between doctest examples what: - Add unset_hook cleanup after first set_hooks example - Ensures clean state before clear_existing=True example Squash target: 8a37592 (hooks refactor: rename set_hooks_bulk)
1 parent 3907aa7 commit 9ae32ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/libtmux/hooks.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,9 @@ def set_hooks(
449449
>>> sorted(hooks.keys())
450450
[0, 1]
451451
452+
>>> session.unset_hook('session-renamed')
453+
Session($...)
454+
452455
Set hooks from a list (sequential indices):
453456
454457
>>> session.set_hooks('after-new-window', [

0 commit comments

Comments
 (0)