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

Add support for hyperlinks in text (OSC8) #391

Open
lypanov opened this issue Jan 8, 2020 · 5 comments
Open

Add support for hyperlinks in text (OSC8) #391

lypanov opened this issue Jan 8, 2020 · 5 comments
Labels
Feature Feature request/implementation proposal

Comments

@lypanov
Copy link

lypanov commented Jan 8, 2020

An interesting specification to add hyperlinking support directly to terminal emulators has been created, see: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

I'd like to use this support in a small patch I'm creating for the application alot which uses urwid as it's TUI layer.

I've created a patch for URWID to add such functionality and would love feedback on it. I'll upload the patch to a PR as soon as I've cleaned it up enough for public eyes.

Would you be interested in such a patch?

@tonycpsu
Copy link
Collaborator

tonycpsu commented Jan 8, 2020

Certainly!

@lypanov
Copy link
Author

lypanov commented Feb 19, 2020

Sorry delayed on this until I find the time to finish off my MR. My current branch is at: lypanov@a6351f6

It fills my need (I have working but weird looking links in alot) but right now it's both a mess and incomplete.

@danschwarz
Copy link
Contributor

danschwarz commented Jan 6, 2023

Any update on this? I see your code and the ansi widget where you've implemented the feature.

I tried to implement this for the Toot Mastodon client, and in my first pass I took a different approach; I have a wrapper that can surround text with an OCS 8 escape sequence and turn it into a clickable hyperlink. This is OK for a standalone link, but insufficient for rendering a hyperlink within a block of ordinary text.

It'd be ideal to have a new Text widget that includes support for embedding hyperlinks with the OCS 8 sequence. I've tried several different approaches to modify the Text widget and add that feature. Haven't found an elegant way to implement it, yet.

@lypanov
Copy link
Author

lypanov commented Mar 7, 2023

Sorry for the lack of feedback here. Once my RSI has calmed down I'm hoping to resurrect my merge request which I assume conflicts horribly with the latest version of urwid. I'm unsure what the best approach is alas. The approach I took in the patch set was the most pragmatic route to getting it working for my specific use case. I'm happy there seems to be more interest in OSC 8 at least. I chose Ansi Widget purely because this was the route that alot took for some complex rendering and I based my work upon that. I'll check the status of that work also.

@danschwarz
Copy link
Contributor

danschwarz commented May 17, 2023

There's a nice solution in the Urwidgets project by @AnonymouX47 , a Hyperlink widget plus a TextEmbed widget. I've been working with it.

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

No branches or pull requests

4 participants