From ee4bb4cbfa67472f588d14a1da7c3853630aa2a8 Mon Sep 17 00:00:00 2001 From: Felix Martin Date: Wed, 10 Jun 2026 22:02:09 -0400 Subject: [PATCH] feat: expose tmux window index reset --- src/hqt/tmux/manager.py | 4 ++++ tests/test_tmux.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/hqt/tmux/manager.py b/src/hqt/tmux/manager.py index 5d7dd3a..5360267 100644 --- a/src/hqt/tmux/manager.py +++ b/src/hqt/tmux/manager.py @@ -116,3 +116,7 @@ class TmuxManager: async def set_window_label(self, window_name: str, label: str) -> None: """Set the status-bar label for a window (status symbol + name).""" await self.runner.set_window_label(window_name, label) + + async def reset_window_indexes(self, home_window: str) -> bool: + """Compact tmux window indexes while keeping the home window at 0.""" + return await self.runner.reset_window_indexes(home_window) diff --git a/tests/test_tmux.py b/tests/test_tmux.py index 69515bd..eb50f03 100644 --- a/tests/test_tmux.py +++ b/tests/test_tmux.py @@ -1041,6 +1041,17 @@ async def test_manager_set_window_label_delegates(runner): assert "○ deadproj" in args +@pytest.mark.asyncio +async def test_manager_reset_window_indexes_delegates(runner): + mgr = TmuxManager(runner) + runner.reset_window_indexes = AsyncMock(return_value=True) + + result = await mgr.reset_window_indexes("⌂ HQT") + + assert result is True + runner.reset_window_indexes.assert_awaited_once_with("⌂ HQT") + + @pytest.mark.asyncio async def test_apply_theme_sets_session_scoped_status_options(runner): """apply_theme themes the status bar in one atomic styling call.