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 file:// links #954

Open
lonix1 opened this issue Sep 8, 2022 · 1 comment
Open

Clickable file:// links #954

lonix1 opened this issue Sep 8, 2022 · 1 comment
Labels

Comments

@lonix1
Copy link
Contributor

lonix1 commented Sep 8, 2022

In #75 support was added for clickable hyperlinks:

AnsiConsole.MarkupLine("[link=https://www.example.com]Foo[/]");
AnsiConsole.MarkupLine("[link]https://www.example.com[/]");

It would be nice to also have file:// links:

// watch for the triple slash on linux/macos for an absolute path
AnsiConsole.MarkupLine("[link=file:///home/username/file.txt]Foo[/]");
AnsiConsole.MarkupLine("[link]/home/username/file.txt[/]");

In my linux system (gnome terminal) those sort of links, when clicked, open the corresponding file in the default associated app. I'm sure it's similar on mac, I'm unsure about windows.

It's rendered like this, but ideally the file:// should not be shown:
file:///home/username/file.txt

It would be a nice addition. Thanks for considering it!


Please upvote 👍 this issue if you are interested in it.

@phil-scott-78
Copy link
Contributor

@lonix1, if you want to give it a go on a PR I'd be happy to review it. I'm pretty sure Windows Terminal didn't support them when we added links but with microsoft/terminal#7526 that isn't the case any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo 🕑
Development

No branches or pull requests

3 participants