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.

Ansi Links capability detection is not very precise

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently as far as I could determine Ansi link support is determined by checking if a terminal supports Ansi, and the terminal is not cmd.exe (basically what it comes down to I think) or has link support disabled explicitly through an Enhancer. There are as far as I can tell a lot of terminal emulators that support for example Ansi colours but not Ansi links (powershell, visual studio developer terminal, visual studio debugger console). I believe this combination can mean that if you use the capability check to decide if you can pretty-print a uri on a given terminal that you can end up printing something entirely unusable to the user, because the terminal cannot interpret the uri portion of the link and only prints the text portion. To be safe I think I should choosing to always print the full uri as the link text, which kinda defeats the purpose of using Ansi links to pretty print in the first place.

Describe the solution you’d like The capability detection should determine whether or not the terminal in question actually supports Ansi links, not just that it supports Ansi.

Additional context I know a library for the npm ecosystem that tries to do this, it involves sometimes specific checks for specific terminals or environments. This might be too much of a maintenance headache but at least they provide a starting point/shared codebase. See: https://github.com/jamestalmage/supports-hyperlinks

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
patriksvenssoncommented, Mar 5, 2022

There currently is no standardized way of detecting this capability, so we just make assumptions. We’re happy to update the rules for this if you have any concrete suggestions.

0reactions
rouke-broersmacommented, Mar 6, 2022

@patriksvensson until there is a way to detect ansi link support we have the workaround of printing the link path as the link text. This is what we had before anyway so it is acceptable. It would be nice if some day there would be a way to detect this so we can make it prettier.

Would you know of a place where I could suggest something like this? So far it seems like the ansi link feature comes entirely from one user with a gist on GitHub who’s been pushing for support at well known terminal maintainers…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detecting 'text' file type (ANSI vs UTF-8)
There is no 100% sure way to recognize ANSI (e.g. Windows-1250) encoding from UTF-8 encoding. There are ANSI files which cannot be valid ......
Read more >
FAQ | ANAB Accreditation
Frequently asked questions about the ANSI National Accreditation Board (ANAB) on ANAB, recognition, lab accreditation, management, and more.
Read more >
Hyperlinks in Terminal Emulators
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or...
Read more >
Verification Qualification and Certification - CableIQ
Qualification tools test the cabling to determine whether or not certain ... Figure 3 Certification tools take very precise measurements on parameters ......
Read more >
Updated ANSI Standards Address New Power Metering ...
The revision introduces six new tests to verify meter accuracy under a variety of non-sinusoidal voltage and current conditions. These latest ...
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