Skip to content

feat: make hook hint deep links clickable using OSC 8 terminal hyperlinks#13734

Merged
ndeloof merged 1 commit intomainfrom
os8link-for-hint
Apr 15, 2026
Merged

feat: make hook hint deep links clickable using OSC 8 terminal hyperlinks#13734
ndeloof merged 1 commit intomainfrom
os8link-for-hint

Conversation

@glours
Copy link
Copy Markdown
Contributor

@glours glours commented Apr 14, 2026

What I did

Wrap the docker-desktop://dashboard/logs URL in OSC 8 escape sequences with underline styling so it appears as a clickable link in supported terminals. Respects NO_COLOR and COMPOSE_ANSI=never to suppress escapes.

Related issue
N/A

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

Copilot AI review requested due to automatic review settings April 14, 2026 14:25
@glours glours requested a review from a team as a code owner April 14, 2026 14:25
@glours glours requested a review from ndeloof April 14, 2026 14:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Compose hook “next steps” hint to render the Docker Desktop logs deep link as a clickable OSC 8 terminal hyperlink (with underline styling), while suppressing escape sequences when ANSI output is disabled via NO_COLOR or COMPOSE_ANSI=never.

Changes:

  • Added Osc8Link helper to generate OSC 8 hyperlinks when ANSI is enabled.
  • Updated hook hint templates to use hyperlink-wrapped deep links, gated by env-based ANSI suppression.
  • Added unit tests for OSC 8 link formatting and hook output under ANSI-enabled/disabled conditions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
cmd/formatter/ansi.go Adds OSC 8 hyperlink helper and improves lenAnsi documentation.
cmd/formatter/ansi_test.go Adds tests validating OSC 8 hyperlink output and ANSI-disabled behavior.
cmd/compose/hooks.go Converts hint templates to functions and wraps the deep link using OSC 8 when allowed.
cmd/compose/hooks_test.go Updates existing expectations and adds tests for OSC 8 presence/absence based on env.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/formatter/ansi.go Outdated
Comment thread cmd/compose/hooks.go Outdated
Comment thread cmd/compose/hooks_test.go Outdated
@glours glours force-pushed the os8link-for-hint branch from 0249bfa to 6734d5e Compare April 14, 2026 16:36
@afurm
Copy link
Copy Markdown

afurm commented Apr 14, 2026

The template string field on hookHint was changed to template func() string, and callers switched to hint.template() — this shifts from a static string to a lazy evaluation. The original design appeared to call enc.Encode once per hook invocation, so lazy evaluation should be fine here. However, if hookHint is ever used in a way where the template is inspected rather than rendered (e.g., log output, JSON marshaling of the struct itself), the function would not serialize correctly. Does any code path marshal hookHint directly to JSON?

…inks

Wrap the docker-desktop://dashboard/logs URL in OSC 8 escape sequences
with underline styling so it appears as a clickable link in supported
terminals. Respects NO_COLOR and COMPOSE_ANSI=never to suppress escapes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
@glours glours force-pushed the os8link-for-hint branch from 6734d5e to 821d3a6 Compare April 15, 2026 09:09
@ndeloof ndeloof merged commit efb0901 into main Apr 15, 2026
116 of 118 checks passed
@ndeloof ndeloof deleted the os8link-for-hint branch April 15, 2026 10:11
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Apr 16, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | patch | `v5.1.2` → `v5.1.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v5.1.3`](https://github.com/docker/compose/releases/tag/v5.1.3)

[Compare Source](docker/compose@v5.1.2...v5.1.3)

#### What's Changed

##### 🐛 Fixes

- fix: provider output handling and watch rebuild re-invocation by [@&#8203;glours](https://github.com/glours) in [#&#8203;13732](docker/compose#13732)

##### 🔧  Internal

- Add Docker Desktop Logs view hints and navigation shortcut by [@&#8203;glours](https://github.com/glours) in [#&#8203;13721](docker/compose#13721)
- Build and push Docker Desktop module image on release by [@&#8203;glours](https://github.com/glours) in [#&#8203;13726](docker/compose#13726)
- Fix typo in SECURITY.md by [@&#8203;glours](https://github.com/glours) in [#&#8203;13730](docker/compose#13730)
- Make hook hint deep links clickable using OSC 8 terminal hyperlinks by [@&#8203;glours](https://github.com/glours) in [#&#8203;13734](docker/compose#13734)
- Remove 'provenance' attribute' by [@&#8203;glours](https://github.com/glours) in [#&#8203;13738](docker/compose#13738)

##### ⚙️ Dependencies

- build(deps): bump github.com/containerd/containerd/v2 from 2.2.2 to 2.2.3 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13737](docker/compose#13737)

**Full Changelog**: <docker/compose@v5.1.2...v5.1.3>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMjAuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
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.

4 participants