Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): keep PowerShell prompt paths with spaces in one link #23527

MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/23527/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Problem

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: image image

After: image image

  • 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. Approvability

      Verdict: Approved at c177187

      Macroscope'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).
    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      📥 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.ts
      • apps/web/src/terminal-links.ts
      • apps/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.ts
      extractTerminalLinks adds 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: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the main fix: preserving PowerShell prompt paths that contain spaces as one link.
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Description checkPassedThe 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
      Comment `@coderabbitai help` to get the list of available commands.

Sign in to join this conversation.