4

I used this command to set my word char boundaries so that on double-clicking it doesn't just select whole word between whitespace.For eg. in /user/ab/deb when I double click on 'ab' I just want ab to be selected instead of /user/ab/deb which is what is happening now. I followed the post here https://unix.stackexchange.com/questions/174728/gnome-classic-terminal-mouse-double-click-selection

dconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/word-char-exceptions '@ms "-#%&+,./:=?@_~"'

I can see the properties on the command line as well as in dconf-editor :

~>dconf list /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/
default-size-columns
default-size-rows
use-theme-transparency
scroll-on-output
visible-name
word-char-exceptions

But the value is not taking effect and double clicking is still selecting the whole word between spaces instead of the characters mentioned. I restarted the terminal etc.

2 Answers2

2

The problem with @ms variable is that it may have inverse logic. As for me, dconf works. So, here is my commands to control 2-click selection:

UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
dconf write /org/gnome/terminal/legacy/profiles:/:${UUID}/word-char-exceptions "@ms '_.^~'"

At Ubuntu 20.04.5 LTS.

Jackal
  • 43
  • 5
1

The dconf approach no longer seems to work on Ubuntu 20.x LTS and maybe others. This worked for me:

UUID=$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${UUID}/ word-char-exceptions '@ms "-/@_&.?"'   
Jackal
  • 43
  • 5