question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for hyperlinks

See original GitHub issue

EDIT: 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:closed
  • Created 5 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
sindresorhuscommented, Jan 13, 2019

@langpavel I would be happy to add support for stderr in terminal-link 😉

https://github.com/sindresorhus/terminal-link/issues/4

1reaction
sindresorhuscommented, Dec 28, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found