18

Is it possible to disable hyperlinks in gnome-terminal? The terminal should never underline any text, and clicks should always start selecting.

There are two reasons why I want to do this: First, I simply click into a terminal window when it's at the back without looking what's in the terminal, and often accidentally click a hyperlink that's there. Second, when using npm, there will be lots of text that look like e-mail addresses, but which aren't, e.g. react@0.13.3.

  • You mean gconf-editor? I tried that, but didn't find the option. OK, maybe I'll try a different terminal emulator. – digory doo Sep 8 '15 at 6:31
  • 1
    No, Ubuntu now uses dconf-editor. The gconf-editor is mostly deprecated on newer releases. – clearkimura Sep 8 '15 at 6:34
  • Really? Good to know... – digory doo Sep 8 '15 at 9:02
10
+50

Unfortunately gnome-terminal offers no configuration option to disable these. You might want to recompile it, removing the entries from url_regex_patterns in src/terminal-screen.c.

This hyperlink feature doesn't influence the normal text selection by mouse, you can still click and select the text. Clicking on a hyperlink to bring the window forward shouldn't have any undesired side effect. (The feature influences the rarely used rectangular selection (Ctrl+Click becomes "open link" instead), and populates the right-click menu with extra entries.)

Of course, I understand that underlining the text and changing the mouse pointer shape on hover is visually unpleasant when you have many false matches, but I don't see how it causes an actual behavioral problem.


Update:

gnome-terminal version 3.18.3 reimplements the matcher regular expressions from scratch, in a way that leads to much fewer false positives than in preceding versions. E.g. "react@0.13.3" is no longer treated as a valid e-mail address.

  • Any idea if it can be configured to allow clicking on file:///... paths with spaces? The usual strategies (quotes, escaping) don't seem to work, i.e. whatever I do, I can't get a file:///... url to ctrl+click-open properly because the term only recognises the part of the path up to the first space. – Tomislav Nakic-Alfirevic Feb 4 '18 at 22:03
  • 1
    Space is not an allowed character in URIs, use %20 instead. If you expect file:// followed by a literal (unencoded) filename to work, you'll have troubles with plenty of other characters too. Also if we made a special case and allowed spaces, I guess your next problem would be that it includes the rest of the line/paragraph and doesn't stop at that other space... so it would need to read your mind, or at least check for the existence of the file by stopping at various space characters... no. – egmont Feb 4 '18 at 22:09
  • This just goes to show that no conclusion is too obvious to miss when you come at it from a weird enough angle: thanks for the %20 remark, that did it! – Tomislav Nakic-Alfirevic Feb 4 '18 at 22:42
8

Actually, It works as you need in Ubuntu 14.04 (gnome-terminal 3.6) and in Ubuntu 15.04 (gnome-terminal 3.14)

Links activated only with:

  • a Left Click while holding Ctrl
  • or using Right Click → Open Link.

Double Click makes selection.

  • 1
    Nice workaround, although I hoped I could just turn the whole feature off. – digory doo Sep 14 '15 at 14:03
  • @digorydoo , which release do you have? – user.dz Sep 14 '15 at 14:20
  • 1
    It's Ubuntu 14.04. – digory doo Sep 16 '15 at 14:07

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.