Skip to content

Add github_pr item with OSC 8 clickable link and nerd font icon#639

Open
JefStat wants to merge 1 commit into
IlanCosman:mainfrom
JefStat:feat/github-pr-item
Open

Add github_pr item with OSC 8 clickable link and nerd font icon#639
JefStat wants to merge 1 commit into
IlanCosman:mainfrom
JefStat:feat/github-pr-item

Conversation

@JefStat
Copy link
Copy Markdown

@JefStat JefStat commented Feb 20, 2026

Summary

  • Adds a new github_pr prompt item that displays the GitHub PR number for the current branch
  • PR number is rendered as an OSC 8 clickable hyperlink to the PR URL (e.g., #1234 links to the PR page)
  • Uses nerd font icon U+F408 (git-pull-request) via tide_github_pr_icon universal variable
  • Fetches both number and url in a single gh pr view call with jq: "\(.number)|\(.url)"
  • Uses command substitution instead of piped read to reliably capture both fields
  • 5-minute file-based cache keyed by git toplevel + branch name, with platform-aware stat for TTL (Darwin/Linux)
  • Cache format: number|url (e.g., 1234|https://github.com/owner/repo/pull/1234)
  • Validates cache content before rendering (count check, non-empty parts, string split -m 1)
  • Includes theme colors for all 6 config variants (rainbow, classic, lean + 16color) and icon in icons.fish
  • Includes littlecheck tests covering: gh not installed, not in git repo, no PR, with PR, cached result, cached negative result

Test plan

  • fish --no-execute passes on all new/modified files
  • fish_indent --check passes on all new/modified files
  • littlecheck tests pass for _tide_item_github_pr.test.fish
  • OSC 8 byte sequence verified correct via od (ESC]8;;URL ESC\ #NUM ESC]8;; ESC)
  • Verify clickable link renders in a terminal with OSC 8 support (iTerm2, Kitty, etc.)
  • Verify cache TTL expiry works (wait 5 minutes or modify mtime)
  • Verify no output when gh is not installed or no PR exists

🤖 Generated with Claude Code

Displays the GitHub PR number for the current branch using `gh pr view`.
Results are cached for 5 minutes to avoid network calls on every prompt.
Includes theme colors for all 6 config variants and littlecheck tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@JefStat JefStat changed the title Add github_pr item to show PR number in prompt Add github_pr item with OSC 8 clickable link and nerd font icon Feb 20, 2026
@JefStat JefStat marked this pull request as ready for review February 20, 2026 21:03
@JefStat JefStat requested a review from IlanCosman as a code owner February 20, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant