From 115d0ffc019dd27ac7b35fef3633e34912aa0e37 Mon Sep 17 00:00:00 2001 From: Felix Martin Date: Wed, 10 Jun 2026 21:22:53 -0400 Subject: [PATCH] Add TmuxManager.open_aux_window delegate Co-Authored-By: Claude Opus 4.8 --- src/hqt/tmux/manager.py | 9 +++++++++ tests/test_tmux.py | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/hqt/tmux/manager.py b/src/hqt/tmux/manager.py index 5d7dd3a..94b031c 100644 --- a/src/hqt/tmux/manager.py +++ b/src/hqt/tmux/manager.py @@ -116,3 +116,12 @@ 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 open_aux_window( + self, name: str, cwd: str, command: list[str], label: str + ) -> str | None: + """Open a styled tool window (non-session) and switch to it. + + Returns the new window_id, or None on failure. + """ + return await self.runner.new_aux_window(name, cwd, command, label) diff --git a/tests/test_tmux.py b/tests/test_tmux.py index 52b735b..c9047b8 100644 --- a/tests/test_tmux.py +++ b/tests/test_tmux.py @@ -1083,3 +1083,14 @@ async def test_new_aux_window_kills_window_when_set_option_fails(runner): assert wid is None # the half-built window must be cleaned up by id. assert runner._exec.call_args_list[-1].args == ("kill-window", "-t", "@7") + + +@pytest.mark.asyncio +async def test_manager_open_aux_window_delegates(runner): + from unittest.mock import AsyncMock + + runner.new_aux_window = AsyncMock(return_value="@4") + mgr = TmuxManager(runner) + wid = await mgr.open_aux_window("nvim", "/p", ["nvim"], "nvim · p") + assert wid == "@4" + runner.new_aux_window.assert_awaited_once_with("nvim", "/p", ["nvim"], "nvim · p")