2023-12-10

Having URLs selected in gnome-terminal again by double clicking

Starting with Fedora 21, double-clicking on a URL in a regular terminal window no longer selects something useful, but for example //example.com, without https:.
This behavior is also annoying when trying to copy a randomly generated password with special characters to the clipboard.

This is because the colon character was removed from gnome-terminal's word character exception list, and gnome 3 has even done away with the corresponding settings control.

To fix do:

#!/bin/bash
MY_DEFAULT_PROFILE=/org/gnome/terminal/legacy/profiles:/:`gsettings get org.gnome.Terminal.ProfilesList default | tr -d \'`
dconf read $MY_DEFAULT_PROFILE/word-char-exceptions
dconf write $MY_DEFAULT_PROFILE/word-char-exceptions '@ms "-#%&+,./:?@_~"'
dconf read $MY_DEFAULT_PROFILE/word-char-exceptions