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

Less's hyperlink support is confused by lines that run offscreen #202

Closed
ferdnyc opened this issue Sep 20, 2021 · 3 comments
Closed

Less's hyperlink support is confused by lines that run offscreen #202

ferdnyc opened this issue Sep 20, 2021 · 3 comments

Comments

@ferdnyc
Copy link

ferdnyc commented Sep 20, 2021

I think this is likely a less bug, as the same issue would theoretically (but does not) occur with color escapes and other formatting.

Using less 581 (from Fedora package less-581.2-1.fc34.x86_64) to display output from systemd's journalctl which contains hyperlinked text, gets confused if the end of that link is offscreen (due to unwrapped lines and horizontal scrolling), letting the hyperlink formatting bleed into the following text indefinitely.

For example, if I run a journalctl command which I know will contain hyperlinks, and resize my terminal window to push the end of a link off the right edge of the window, I get this:

image

Everything after the first linked /usr/lib/tmpfiles.d/... path is hyperlinked, due to the closing code being offscreen to the right. (The text appears to be genuinely hyperlinked, BTW — hovering over any of the underlined text will display a URL tooltip in GNOME Terminal, and the context menu will show the added options to copy or open the link.)

If I scroll right so the ends of the linked paths are visible, the problem corrects itself:

image

(The text before the first link is hyperlinked, because the bleedover caused the last link to remain open until the formatting closed it. If I scroll right again, that clears up as well:)

image

The bright-white/bold formatting of the same text doesn't bleed onto the following lines, even when the ends of those lines are offscreen, so this appears to be a problem unique to the hyperlink support.

@gwsw
Copy link
Owner

gwsw commented Oct 1, 2021

Fixed in d21820c.

@ferdnyc
Copy link
Author

ferdnyc commented Oct 2, 2021

Confirmed!

image

Many thanks.

@ferdnyc ferdnyc closed this as completed Oct 2, 2021
@ferdnyc
Copy link
Author

ferdnyc commented Oct 19, 2021

Now if I can get the Fedora packagers to merge my backport PR, this won't be an issue in Fedora 35+.

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