Double clicking on a word in gnome terminal selects the whole word. Unfortunately, this selection doesn't include colons such that URLs aren't completely selected, e.g. with

http://foo.example.org/

only

//foo.example.org/

is selected.

How do I configure this selection behavior such that complete URLs are selected?

See also:

share|improve this question
up vote 7 down vote accepted

How much is selected on double click can be configured via adding additional character classes to the default set. That means that adding a colon and other special characters that may show up in URLs leads to double click also selecting complete URLs.

This can be configured via the gnome config database. For that one has to get the id of the gnome shell profile. To get the default one:

pid=$(dconf read /org/gnome/terminal/legacy/profiles:/default | tr -d "'")

Adding some URL related characters:

dconf write /org/gnome/terminal/legacy/profiles:/:$pid/word-char-exceptions \
  '@ms "-=&#:/.?@+~_%;"'

Note that:

  • @ms denotes the maybe-string gvariant type
  • the character class syntax matches the regex one, i.e. a-z specifies a range, where -az specified the literal 3 characters. Thus, I have explicitly put the - in the first position

History: In classic Gnome Terminal versions, the profile preference dialog contained a field for configuring those additional characters. With Gnome 3, UI experts have removed this option from the dialog because they thought it was too complicated to use, though. The default was also changed after Fedora 21.

share|improve this answer
5  
"experts" should be in quotes. :> – jhermann Jun 20 '16 at 14:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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