Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clickable named report url in terminal #1394

Closed
rouke-broersma opened this issue Feb 3, 2021 · 5 comments
Closed

Clickable named report url in terminal #1394

rouke-broersma opened this issue Feb 3, 2021 · 5 comments
Labels
Area: CLI CLI and options related Area: Reporters 🚀 Feature request New feature or request

Comments

@rouke-broersma
Copy link
Member

rouke-broersma commented Feb 3, 2021

Is your feature request related to a problem? Please describe.
Our report urls are fully qualified. Some terminals support named urls. It might also be good to add a file protocol to the existing url's so it's easier to detect the local filepath as an url by terminals that already support this.

This is different from #1395 in that the URI's would no longer need to be prefixed by file:// as we would prefix them with invisible ANSI characters that provide the same hint to supported terminals.

Describe the solution you'd like
Apparently there is ansi support for clickable named links. Some terminals implement this and in those terminals we could use this. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

Additional context
We do not want to print the named url stuff on terminals that do not support this as the characters might simply be printed to the console which makes it hard for users to open the file links.

I could find javascript libraries for this but no csharp library. We could create our own library (and publish it?) based on for example https://github.com/sindresorhus/terminal-link/blob/main/index.js

Support for clickable links is added to the new windows terminal which means our largest user base will at some point have this feature available to them: microsoft/terminal#204

@rouke-broersma rouke-broersma added the 🚀 Feature request New feature or request label Feb 3, 2021
@eNeRGy164
Copy link
Contributor

I did something like this for FluentAssertions's build process: https://github.com/fluentassertions/fluentassertions/blob/develop/Build/Build.cs#L171

Is that what you are looking for?

@rouke-broersma
Copy link
Member Author

I think that is the same yes, however I'm worried about

We do not want to print the named url stuff on terminals that do not support this as the characters might simply be printed to the console which makes it hard for users to open the file links.

I don't know if that's an actual problem. If terminals that don't support this simply drop the unrecognizable ansi then that's fine to me. If they don't then we will need some way of keeping track of which terminal supports this and only print the characters in those consoles. Preferably we would not maintain a list of supported terminals in stryker but so far I have not found a package for this.

@eNeRGy164
Copy link
Contributor

I think I remember CMD just ignored the ANSI hyperlink part.

However, in GitHub actions is just doesn't show anything: https://github.com/fluentassertions/fluentassertions/runs/5270152443?check_suite_focus=true#step:4:285

@eNeRGy164
Copy link
Contributor

Maybe with Spectre? spectreconsole/spectre.console#160

@rouke-broersma
Copy link
Member Author

Maybe with Spectre? spectreconsole/spectre.console#160

That's cool!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: CLI CLI and options related Area: Reporters 🚀 Feature request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants