refactor(process): inject YNHCommandRunner into EditorRegistry + TerminalSessionManager (#273)#290
Merged
Merged
Conversation
…inalSessionManager (#273) Two of the three direct `Process()` sites flagged in #273 fit the existing `YNHCommandRunner` shape — single-shot fire-and-forget subprocesses with no streaming, lifecycle, or pipe semantics: - `EditorRegistry.which(_:)` — `/usr/bin/which <bin>`. `start()` and `detect()` become async; `start()` schedules the work on a Task so the AppDelegate caller stays sync. - `TerminalSessionManager.sendTmuxCommand(_:to:)` — fire-and-forget `tmux <command> -t <session>`. Both sites now take `commandRunner: any YNHCommandRunner` at init, defaulting to `LiveYNHCommandRunner`. The protocol is mildly misnamed for non-YNH callers but reusing it avoids cosmetic churn across six existing files; renaming can come later if it grates. The third site, `TmuxControlModeSession.connect()` (line 96), is explicitly out of scope here — it needs the full Process lifecycle plus Pipe/FileHandle streaming abstraction that #273 itself flagged as a separate follow-on. Filed as #289. Tests: - New `EditorRegistryTests` (5 tests): bundle-id hit short-circuits `which`, success/empty/failure paths for the runner, exact args asserted on the captured invocations. - `TerminalSessionManagerTests`: smoke-test that `sendTmuxCommand` no-ops cleanly when no session exists for the card. End-to-end happy-path for the runner is hard to drive without real session state and is left for #289's follow-up. Closes #273 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tests
Closes #273.
Test plan
🤖 Generated with Claude Code