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

Implement terminal hyperlinks #300

Closed
Seanstoppable opened this issue Aug 31, 2019 · 4 comments
Closed

Implement terminal hyperlinks #300

Seanstoppable opened this issue Aug 31, 2019 · 4 comments

Comments

@Seanstoppable
Copy link

From: rivo/tview#108

I am referring to: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda

When user use below command in terminal:
echo -e '\e]8;;http://example.com\aThis is a link\e]8;;\a'

In my case, I could get the link in iterm2/terminal app.
@gdamore
Copy link
Owner

gdamore commented Sep 1, 2019

This is interesting -- but I am concerned that it's hard to specify this cleanly, and it will need some kind of new API as the rendering will vary from terminal to terminal. It needs some thought.

@gdamore
Copy link
Owner

gdamore commented Sep 22, 2019

tcell needs to keep a record of what the occupants of every cell are. This is pretty hard to do with this approach, and will put some fairly big challenges on the application code.

@hhirtz
Copy link
Contributor

hhirtz commented Jan 26, 2021

Hi, i'm writing an IRC client on top of tcell and this is an interesting feature to have when links wrap on multiple lines. How do you want this to be implemented?

tcell needs to keep a record of what the occupants of every cell are.

How about a hyperlink string field in Style:

tcell/style.go

Lines 25 to 29 in 19e1709

type Style struct {
fg Color
bg Color
attrs AttrMask
}

and a function to set its value (when url is empty, disable the hyperlink).

func (s Style) Hyperlink(url string) Style {}

@emersion
Copy link
Contributor

This looks like a reasonable design, @hhirtz. I've tried implementing it in #468.

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

Successfully merging a pull request may close this issue.

4 participants