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

xterm.js Web Links #11

Open
daddycocoaman opened this issue Jun 26, 2024 · 2 comments
Open

xterm.js Web Links #11

daddycocoaman opened this issue Jun 26, 2024 · 2 comments

Comments

@daddycocoaman
Copy link

I have an application where I would like to allow the user to export the data. Since downloading isn't implemented in textual-serve yet, I decided to just provide the user a link which should be clickable in the browser. It seems like XTerm.js doesn't support this out the box, but has an official addon for this:

https://github.com/xtermjs/xterm.js/tree/master?tab=readme-ov-file#addons
https://www.npmjs.com/package/@xterm/addon-web-links

This might be useful to add for textual-serve.

@daddycocoaman
Copy link
Author

I forgot to mention, as a workaround in the meantime, you can make OSC 8 hyperlinks manually:

def terminal_link(url, text):
    """Return a terminal hyperlink."""
    return f"\033]8;;{url}\033\\{text}\033]8;;\033\\"

This will create a clickable link in the browser.

@davidfokkema
Copy link

I think Textual supports this now: https://textual.textualize.io/blog/2024/09/08/towards-textual-web-applications/#opening-web-links. Does that help? It is a bit flaky on Safari, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants