Support for hyperlinks
See original GitHub issueEDIT: See sindresorhus/terminal-link
Trivial implementation:
function hyperlink(text, url, attrs) {
return `\u001b]8;${attrs || ''};${url || text}\u0007${text}\u001b]8;;\u0007`;
}
Usage:
console.log(
`See issue ${
hyperlink('#319 on GitHub', 'https://github.com/chalk/chalk/issues/319')
}`
);
For more info see Hyperlinks (a.k.a. HTML-like anchors) in terminal emulators
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
supports-hyperlinks - npm
Detect if your terminal emulator supports hyperlinks. Latest version: 2.3.0, last published: 3 months ago. Start using supports-hyperlinks ...
Read more >Create or edit a hyperlink - Microsoft Support
Create a hyperlink to a location on the web · Select the text or picture that you want to display as a hyperlink....
Read more >Detect whether a terminal emulator supports hyperlinks - GitHub
This module allows you to detect if hyperlinks are supported in the current Terminal. As this is a new development, we anticipate the...
Read more >Supports-hyperlinks NPM
This module allows you to detect if hyperlinks are supported in the current Terminal. As this is a new development, we anticipate the...
Read more >Clickable links - Android Accessibility Help - Google Support
Use URLSpan or the convenience class Linkify to display hyperlinks in an app's user interface. An accessibility service is more likely to detect...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@langpavel I would be happy to add support for
stderr
interminal-link
😉https://github.com/sindresorhus/terminal-link/issues/4
I think it’s way too early to add this to Chalk, if at all. I like to see it more widely supported first. For now, we can just recommend
terminal-link
. Honestly not even sure if it makes sense to have this in Chalk. Chalk is for visual styling, while hyperlinks are functional. This is a slippery slope. If we accept this, we should expect to get requests to support other ansi escape codes, like hiding the cursor, etc.