Skip to content

Add OSC 8 hyperlink rendering to wp help description links with footnote fallback#6332

Merged
swissspidy merged 7 commits into
mainfrom
copilot/support-hyperlinks-in-help-command
Jun 10, 2026
Merged

Add OSC 8 hyperlink rendering to wp help description links with footnote fallback#6332
swissspidy merged 7 commits into
mainfrom
copilot/support-hyperlinks-in-help-command

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

wp help currently rewrites Markdown links in command descriptions into numbered footnotes. This change adds terminal hyperlink rendering (OSC 8) when supported, while preserving existing footnote output as the compatibility path.

  • Help link rendering behavior

    • Updated Help_Command::parse_reference_links() to choose between:
      • OSC 8 hyperlinks in-place ([label](url) → clickable label)
      • Existing footnote transformation ([label][n] + --- footnotes)
    • Keeps the change scoped to description text before section headers, matching current parsing boundaries.
  • Terminal capability + env override

    • Added supports_hyperlinks() detection logic for hyperlink-capable terminals, aligned more closely with supports-hyperlinks.
    • Added FORCE_HYPERLINK override handling:
      • numeric values: > 0 enables, 0 disables
      • non-empty string enables
    • Added create_hyperlink($url, $text) helper to centralize OSC 8 sequence generation.
    • Extended terminal detection support, including:
      • TERM_PROGRAM: ghostty, zed, WezTerm, vscode (with Cursor support)
      • TERM: alacritty, xterm-kitty
      • expanded VTE_VERSION parsing and handling
  • Targeted test coverage

    • Existing HelpTest::test_parse_reference_links() is pinned to legacy behavior with FORCE_HYPERLINK=0.
    • Added test_parse_reference_links_with_forced_hyperlinks() to validate forced OSC 8 output.
if ( self::supports_hyperlinks() ) {
    return self::create_hyperlink( $url, $label );
}

// fallback: [label][1] + footnotes

Copilot AI linked an issue Jun 9, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Support hyperlinks in help command Add OSC 8 hyperlink rendering to wp help description links with footnote fallback Jun 9, 2026
Copilot AI requested a review from swissspidy June 9, 2026 09:29
@codecov

codecov Bot commented Jun 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
php/commands/src/Help_Command.php 50.00% 40 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread php/commands/src/Help_Command.php Outdated

This comment was marked as resolved.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@swissspidy swissspidy marked this pull request as ready for review June 9, 2026 11:36
@swissspidy swissspidy requested a review from a team as a code owner June 9, 2026 11:36
@swissspidy swissspidy requested a review from Copilot June 9, 2026 14:26

This comment was marked as resolved.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@swissspidy swissspidy requested a review from Copilot June 9, 2026 15:44

This comment was marked as resolved.

Co-authored-by: Copilot Autofix powered by AI <[email protected]>
@swissspidy swissspidy added this to the 3.0.0 milestone Jun 10, 2026
@swissspidy swissspidy merged commit 8b862b7 into main Jun 10, 2026
136 of 139 checks passed
@swissspidy swissspidy deleted the copilot/support-hyperlinks-in-help-command branch June 10, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support hyperlinks in help command

3 participants