-
Notifications
You must be signed in to change notification settings - Fork 220
Open
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Feature Request: Add OSC 8 Hyperlink Support
build_runner currently prints file paths and error locations (both relative paths and package: URIs) as plain text.
Modern terminal emulators and editors (including JetBrains + VS Code) support OSC 8 hyperlinks. These make file paths and error locations clickable, instantly opening the file (optionally, at an exact line and column.)
Adding this to build_runner would improve developer productivity.
Official Specification & References
-
Primary specification – Xterm control sequences (updated June 2025)
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands -
Detailed practical documentation – mintty wiki
https://github.com/mintty/mintty/wiki/CtrlSeqs#hyperlinks
Implementation Notes
- The Dart SDK already has reusable ANSI utilities (detect ANSI support via
stdout.supportsAnsiEscapes). Optionally add a--no-hyperlinksflag for CI environments if necessary. - Resolve the hyperlink target to an absolute
file://URI (required for reliable opening in all terminals/IDEs):- Relative paths (e.g.
lib/src/utils.dart:45) → resolve against the project root using thepathpackage orDirectory.current. - package: URIs (e.g.
package:my_app/utils.dart:120) → resolve viapackage_configorUri.base.resolve()to the real on-disk location (local package or.pub-cache).
- Relative paths (e.g.
- Keep the display text exactly as currently printed (relative or package: form) — only the invisible hyperlink target changes.
Example:
lib/src/utils.dart:45:8 → clickable → file:///Users/me/project/lib/src/utils.dart:45:8
package:my_app/foo.dart:23 → clickable → file:///Users/me/.pub-cache/hosted/pub.dev/my_app-1.2.3/lib/foo.dart:23
Thank you for considering this enhancement!
Metadata
Metadata
Assignees
Labels
type-enhancementA request for a change that isn't a bugA request for a change that isn't a bug