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

Feature request: follow relative links in TUI mode #441

Open
MageJohn opened this issue Jan 16, 2023 · 7 comments
Open

Feature request: follow relative links in TUI mode #441

MageJohn opened this issue Jan 16, 2023 · 7 comments

Comments

@MageJohn
Copy link

Often a directory of markdown files will have relative links to each other. It would be nice if in TUI mode it were possible to follow these links directly.

Note this is seperate from OSC8 hyperlink support (#237). That hands off following the link to the terminal, but in this case it would be useful if Glow were the one following the link so that it opens in the TUI.

To select the links, I imagine pressing tab/shift-tab to move between links and then pressing enter to follow the link. If mouse support is enabled, then it would be awesome to be able to use the mouse as well.

@KaviiSuri
Copy link

Would love to pick this up if it's available!

@carloswm85
Copy link

dart.md file is in the same folder as flutter.md, which contains a link to the former.

WindowsTerminal_ZKnRaDqdww

What you are saying is that that ./dart.md link should open the dart file? Hyperlinks are properly open when holding ctrl + left click, and opening the dart file should work the same way.

@db7
Copy link

db7 commented Jan 11, 2024

That doesn't seem to work in my remote setup with tmux. I think the idea is to navigate the links with some key and then following the link with enter. Something like command line web browsers do. It sounds to me like an awesome feature.

@franalbani
Copy link

This would be really nice as it would allow to make a little interactive navigator for a network of markdown files.

@askoropadsky
Copy link

I'd love this feature too so I can navigate between multiple linked markdown files without taking hands off keyboard!

@richcarl
Copy link

Keyboard navigation of (local) links was the first thing I expected would Just Work (TM) beyond basic formatting and paging when I picked up Glow.

@db7
Copy link

db7 commented Jan 1, 2025

Keyboard navigation of links would be awesome. At the moment, I think this shouldn't be the task of glow, but rather of the $PAGER. The pager should allow for link selection and open the $BROWSER program with the link. The browser can then decide what to do with the link. For example, if it is a local markdown file (in contrast to a https url), it could execv a child glow process to open that file.

What do you think about this design?

Also note, that it might be possible to actually wrap existing pagers to provide such redirection functionality without changing the pager implementations. Some acrobatics with pty and OSC 8 parsing should do the job.

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

7 participants