Skip to content

fix: terminal links open wrong URL for addresses with ports#11369

Merged
RomneyDa merged 3 commits intocontinuedev:mainfrom
shanevcantwell:fix/terminal-url-port-detection
Mar 13, 2026
Merged

fix: terminal links open wrong URL for addresses with ports#11369
RomneyDa merged 3 commits intocontinuedev:mainfrom
shanevcantwell:fix/terminal-url-port-detection

Conversation

@shanevcantwell
Copy link
Contributor

@shanevcantwell shanevcantwell commented Mar 12, 2026

Summary

  • Fixes URL link regex in terminal output to properly capture port numbers in IP address URLs (e.g., http://192.168.137.1:8081)
  • The previous regex was designed for domain names (example.com) and broke on the multiple dots in IP addresses, dropping the :port suffix
  • Simplified the http:///https:// branch to match everything after the protocol until whitespace

Closes #11368

Test plan

  • Updated existing link detection test to include IP:port URL
  • All 13 UnifiedTerminal tests pass
  • Manual verification: run npx http-server -p 8081 and confirm the full URL (with port) is clickable

🤖 Generated with Claude Code


Summary by cubic

Fixes terminal URL link detection so IP address URLs with ports are fully clickable (e.g., http://192.168.137.1:8081). Adds tests to ensure rendered link hrefs include the port.

  • Bug Fixes
    • Simplified the http:///https:// regex to match everything after the protocol until whitespace; kept www. domain matching unchanged.
    • Updated UnifiedTerminal tests to include an IP:port and assert <a> hrefs contain the full URL; applied Prettier formatting to the regex.

Written for commit 193f66d. Summary will update on new commits.

…esses

The link regex was designed for domain names and broke on IP:port URLs like
http://192.168.137.1:8081, only linkifying up to the IP without the port.
Simplified the http/https branch to match everything after the protocol
until whitespace.

Closes continuedev#11368

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@shanevcantwell shanevcantwell requested a review from a team as a code owner March 12, 2026 23:27
@shanevcantwell shanevcantwell requested review from RomneyDa and removed request for a team March 12, 2026 23:27
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 12, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx">

<violation number="1" location="gui/src/components/UnifiedTerminal/UnifiedTerminal.test.tsx:204">
P2: Regression test checks only raw text content and does not validate generated link href, so it may miss the port-truncation bug it is intended to catch.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

The text-only assertion wouldn't catch a regression where the URL
appears in output but the <a> href is truncated (e.g. missing port).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Mar 12, 2026
@shanevcantwell shanevcantwell changed the title fix: terminal URL link detection captures port in IP addresses fix: terminal links open wrong URL for addresses with ports Mar 13, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanevcantwell appreciate the fix!!

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Mar 13, 2026
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 13, 2026
@RomneyDa RomneyDa merged commit 97b203d into continuedev:main Mar 13, 2026
52 of 65 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Issues and PRs Mar 13, 2026
@github-actions github-actions bot locked and limited conversation to collaborators Mar 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Terminal links open wrong URL for addresses with ports

2 participants