fix(ui): report ambiguity on partial process name match#564
Conversation
When multiple processes match a partial --app query and all have visible windows, the code silently fell through to title search which then failed with a misleading 'No running app found' error. Now it throws a clear error listing the matching PIDs and titles, consistent with the exact-name-match path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a UX bug in TryResolveProcess where partial --app name matches that resolved to multiple processes (all with visible windows) silently fell through and produced a misleading "No running app found" error. Now an explicit InvalidOperationException is thrown listing PIDs, process names, and window titles, mirroring the existing exact-name-match disambiguation path.
Changes:
- Added a multi-match branch in the partial-process-name lookup that throws a descriptive error listing all candidate windows.
- Error message includes PID, process name, and window title to guide the user toward a more specific
--appvalue.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Build Metrics ReportBinary Sizes
Test Results✅ 1192 passed, 1 skipped out of 1193 tests in 415.9s (-10.7s vs. baseline) Test Coverage❌ 17.2% line coverage, 36.3% branch coverage · ✅ no change vs. baseline CLI Startup Time40ms median (x64, Updated 2026-06-02 06:16:38 UTC · commit |
When multiple processes match a partial
--appquery (e.g.-a terminalmatching twoWindowsTerminalinstances) and all have visible windows, the code silently fell through to title search which then failed with a misleading No running app found error.Now it throws a clear error listing the matching PIDs, process names, and window titles — consistent with the exact-name-match path: