Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Official solution for custom links (regexp) #5222

Closed
afska opened this issue Nov 21, 2024 · 2 comments
Closed

Official solution for custom links (regexp) #5222

afska opened this issue Nov 21, 2024 · 2 comments

Comments

@afska
Copy link

afska commented Nov 21, 2024

Hi. Thanks for this great project. I wanted to ask if we could get an official solution to register links with any format.

Like https://github.com/LabhanshAgrawal/xterm-link-provider but... official 😅 The problem with that project is that it's not updated anymore, it uses an old Xtermjs version and it has some issues when handling line breaks & emojis (which I attempt to solve in that PR) but also incompatibilities with addon-fit (like links not formatting well if they end in the last character of a line).

I ask primarily because maybe you have a more generic solution working and it'd be a matter of just exposing it. I think a lot of users will find it useful!

@jerch
Copy link
Member

jerch commented Nov 21, 2024

Isn't that basically the same as the web-links addon? Would the addon's API do for you?

Edit: Regarding your index issues in your PR - the index buffer mapping got reworked in the addon, as the old code (also partially used by xterm-link-provider) contained wrong assumptions about char progression on the terminal buffer.

@Tyriar
Copy link
Member

Tyriar commented Nov 21, 2024

Specifically this part of the API that lets you give your own regex:

/**
* A callback to use instead of the default one.
*/
urlRegex?: RegExp;

@xtermjs xtermjs locked and limited conversation to collaborators Nov 21, 2024
@Tyriar Tyriar converted this issue into discussion #5223 Nov 21, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants