Render URLs as clickable OSC 8 hyperlinks, styled to stand out #41
No reviewers
Labels
No labels
⏳in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Grey.ooo/someones.computer_agent!41
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/clickable-urls"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Every URL
scprints — a deployment's page, a failure page, the token orbilling pages — was plain text, no more distinct than anything else on the
line, and never clickable even in terminals that support it.
Adds
ui.LinkTo(and the underlyingui.Link), which wraps a URL in anOSC 8 terminal hyperlink — the mechanism iTerm2, kitty, WezTerm and Windows
Terminal all implement — styled bold/cyan/underlined so it reads as a link.
The row-style outputs (
Watch it:,See it:,Created ...) go further andshow a short clickable word ("open") in place of the bare address, since a
supporting terminal now carries you there directly by clicking the word.
Off a terminal, or with
$NO_COLORset, everything falls back to the plainaddress exactly as before — unchanged behaviour for CI logs and piped
output, which have nothing to click and still need the text.
Where
internal/ui/link.go(new) —Link/LinkToand the OSC 8 wrappinginternal/cli/deploy.go— the uploaded revision's page, and a 409collision's page
internal/cli/preflight.go— a newly created application's pageinternal/cli/apps.go— a failed deployment's failure pageinternal/cli/login.go— the token-minting pageinternal/cli/deploy_progress.go— the failure page and "watch it at"sentences embedded in errors (printed on stderr by
cmd/sc/main.go)internal/cli/service.go,internal/cli/toggle.go— the billing page ina top-up refusal
Test plan
go test ./...— all green, including newinternal/ui/link_test.gocovering both the clickable and fallback paths,
$NO_COLOR, and anempty URL
go vet ./...,gofmt -l .,golangci-lint run ./...— cleanhack/coverage.sh— no package fell below its floor(
internal/ui97.3% → 97.6%,internal/cli80.7% → 85.8%)script) thatsc loginemits acorrect OSC 8 sequence wrapping the styled URL
Every URL sc prints — a deployment's page, a failure's page, the token or billing pages — was plain text competing with the rest of the line. On a terminal that supports OSC 8 hyperlinks (iTerm2, kitty, WezTerm, Windows Terminal, ...) ui.LinkTo now wraps it as a coloured, underlined, clickable link; the row-style outputs ("Watch it:", "See it:", "Created ...") go further and show a short clickable word ("open") instead of the bare address, since the terminal now carries you there directly. Off a terminal, or with $NO_COLOR set, it falls back to the plain address exactly as before — a CI log or piped output has nothing to click, so it still needs the text to read or grep.