2

I want to use the new hyperlinks feature available in ls. However, I find it visually distracting and pointless to have a dotted underline under every single directory and file. For example, given a directory and two files I see the following output:

Directories and files with dotted underlines

Is there any way to remove the dotted underline from beneath the words "One", "Two", and "Three"?

Steve
  • 121
  • Related - https://purpleidea.com/blog/2018/06/29/hyperlinks-in-gnome-terminal/ & https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda. – slm Jul 03 '18 at 04:05

1 Answers1

1

It's not possible to modify the look of these hyperlinks in GNOME Terminal and other VTE-based terminals. At least not without modifying VTE's source, removing the loop that paints them.

I find it visually distracting

The look was chosen to be as little distracting as possible, and without conflicting with any other visual element that terminal emulation offers. E.g. the two common methods of showing them on HTML pages: modifying the color was out of question for the latter reason, and solid underlying was out of question for both of these reasons.

and pointless

I disagree with this. If these links weren't highlighted in some way, you would have basically no chance of knowing that there was some auxiliary data associated with them. You would have to crazily (or systematically) drag the mouse to discover any such text.

Of course you might be aware of a few concrete cases, e.g. that the output of ls --hyperlink consists of such hyperlinks, but you still wouldn't recognize if an application that's brand new to you emits such links, or an app that you're already familiar with adds them as a new feature.

With no visual representation of hyperlinks, the feature would be way less useful.

(It's not like the automatic detection and linkification of http://...-like text. There all the data is already visible, there's indeed no point in underlying. When you hover with the mouse, a solid underline lets you know that the terminal offers some convenient quick ways for some of the actions that you're likely to wish to perform on that piece of text.)

egmont
  • 5,866
  • Thanks @egmont. Apologies if my question came across as rude. I really appreciate you working on this feature. I agree with you that the links are generally not distracting and I'd like to see them used more. It's only the specific case of ls --hyperlink that bothers me and I was hoping there was a workaround. Since it's baked into VTE the answer is no. – Steve May 22 '23 at 03:05
  • @Steve No it didn't come across as rude at all, sorry if it sounded otherwise from my tone. Also sorry for only noticing this question after so many years :) – egmont May 22 '23 at 05:20
  • You can easily change VTE and remove the dots, but then it'll affect all software. VTE trying to figure out if the output comes from ls or another utility is pretty hopeless. Another approach would be to extend the hyperlink protocol for yourself, modify ls to emit an additional attribute and modify VTE to handle it. If you said "no" to modifying VTE then unfortunately it's a double no. – egmont May 22 '23 at 09:17