1

Highlighted text in the default gnome terminal incorrectly includes word boundary characters which should be ignored

for example when I double click on

 &freq_domain_magnitude_buffer_a2i 

it should ignore the leading & and just highlight freq_domain_magnitude_buffer_a2i

In the past below technique worked (it has no effect now) to define a set of such word boundary characters

UUID=$(gsettings get org.gnome.Terminal.ProfilesList default |  tr -d "'" ) #  strip off any single quotes

echo $UUID

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:${UUID}/ word-char-exceptions  '@ms "-#%&+,./:=?@_~"'

Even back when above worked its troubling to see the word legacy ... How to edit the list of word boundary characters ? can this be done using tool dconf-editor ? Is there a better alternative terminal which does support defining word boundary characters ?

This issue goes back years

dconf write word-char-exceptions not taking effect

Can I specify what characters set the double-click selection boundary in GNOME Terminal?

https://unix.stackexchange.com/questions/409017/gnome-terminal-double-click-delimiters

https://bugzilla.redhat.com/show_bug.cgi?id=1165244

On Ubuntu 22.04 gnome terminal (Version 3.44.0 for GNOME 42)

https://wiki.gnome.org/Apps/Terminal

Scott Stensland
  • 14,755
  • 10
  • 55
  • 73

1 Answers1

0

The problem is that gsettings get prints its output within single quotes, i.e. the value of UUID doesn't become the actual UUID that you'd expect but rather that value enclosed in literal apostrophes. You should remove those apostrophes.

It's surely all doable via command line, using either gsettings (as you did) or dconf, and a bit of shell script gluing. However, I find it more convenient to navigate in dconf-editor. As you navigate to /org/gnome/terminal/legacy/profiles:, you'll probably see some of the subfolders already containing apostrophes in their names due to previous runs of the incorrect script that you posted. These are not used by gnome-terminal, you may right-click and "Reset recursively". If you navigate to the given correct profile's word-char-exceptions, you can see the old value or set the new value there.

PS. Don't worry about the word "legacy". I have no idea why it's there, but it's there, it's okay.

egmont
  • 7,790
  • 1
  • 27
  • 37
  • this is not an answer ... thanks anyhow – Scott Stensland Oct 03 '22 at 17:34
  • 1
    Why is this not an answer? Did you fix the problem with the apostrophe and it still doesn't work? – egmont Oct 05 '22 at 05:57
  • yes I updated question with code to strip off surrounding single quotes around UUID however that is not the root issue see updated question ... also did recursive reset using dconf-editor ... still fails to change word boundary characters – Scott Stensland Oct 07 '22 at 18:38
  • I see. I'm sorry but I probably won't be able to further help you out here. It works on my 22.04. – egmont Oct 07 '22 at 18:52