fix(web): keep PowerShell prompt paths with spaces in one link #23527
main fromrefs/pull/23527/head·merged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHubProblem#
The default PowerShell prompt prints its current path without quotes. For PS C:\dev\ai-test\dir 1\test>, T3 stops the clickable path at the space and creates a second link for 1\test. The entire current path should be one clickable region.
Change#
Recognize an absolute filesystem path between the default PowerShell prompt's PS prefix and > delimiter before applying generic link detection. Preserve spaces and punctuation within that path and suppress overlapping partial links. Links in commands after the prompt still use the existing detector.
Web and desktop share this terminal link detector, including remote connections. The fix does not require server, provider, contract, or mobile changes. Custom prompt formats and arbitrary unquoted paths in other output remain outside this focused fix.
Scope and approval#
This is a small, focused fix for an obvious path-link detection bug and qualifies for the no-prior-issue exception in CONTRIBUTING.md. It addresses the reported PowerShell prompt failure without broadly treating prose after paths as part of a filename.
Verification#
Before:
After:
- Before the fix, seven new regression cases failed, reproducing truncation and duplicate links.
- Regression coverage includes spaces, nested folders, drive roots, UNC paths, PowerShell paths on Unix, punctuation, and separate command links. A terminal surface test checks one clickable range across a wrapped prompt and excludes the closing
>. vp run check:changed upstream/main: formatting, lint, dependency audit, affected-package typechecks, and all 75 focused tests passed, including the wrapped prompt test.
Written with gpt-6.1-sol through the Codex harness.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
Approvability#
Verdict: Approved at
c177187Macroscope's review found this PR approvable — This is a small, self-contained terminal-link bug fix that recognizes PowerShell prompt paths containing spaces while preserving existing link detection for commands and output. The added coverage exercises wrapped prompts, path variants, and separation from command URLs.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Source mode: Auto
- Repository: pingdotgg/t3code
- Branch: main
- File: .coderabbit.config.ts
- Commit: 8d3b061
- Layers: Repository TS config
- Review profile: CHILL
- Plan: Advanced
- Run ID:
2e3f8fd6-b073-485c-88f6-fb01d2c4dc6d
📥 Commits
-
Reviewing files that changed from the base of the PR and between 8d3b061121fe65669d5d43d011b48cd3027a4108 and c177187acddde8212e3d917fa66789123e5fdca7.
📒 Files selected for processing: 3
-
apps/web/src/terminal-links.test.tsapps/web/src/terminal-links.tsapps/web/src/terminal/ghostty/surface.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
Terminal link extraction now recognizes paths in leading PowerShell prompts. Tests cover paths with spaces and punctuation, command URLs, trailing prose, and soft-wrapped paths.
Changes: Terminal path link extraction
Layer / File(s) Summary Recognize and validate prompt paths
apps/web/src/terminal-links.ts,apps/web/src/terminal-links.test.ts,apps/web/src/terminal/ghostty/surface.test.tsextractTerminalLinksadds a leading PowerShell prompt path as a match before collecting URLs and other paths. Tests cover path offsets, separate command URLs, excluded trailing prose, and soft-wrapped path ranges.Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
lnieuwenhuis,juliusmarminge
Merge Risk: ⚪ Minimal · up to
c1771-
PowerShell prompt paths with spaces remain a single link in the covered cases, including wrapped paths. No merge-blocking issue was found.
Pre-merge checks:
4-
Check name Status Explanation Title check The title clearly and concisely describes the main fix: preserving PowerShell prompt paths that contain spaces as one link. Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request. Description check The pull request description follows the required template. It explains the problem, fix, scope and approval basis, affected components, verification steps, observed results, screenshots, out-of-scope… Full details: Description check
-
Explanation
The pull request description follows the required template. It explains the problem, fix, scope and approval basis, affected components, verification steps, observed results, screenshots, out-of-scope behavior, and the model and harness used.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Yash-Singh1(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes