String delimiters in terminals (e.g. xterm)

OK - this is a piece of cake to do in MacOS - I use iterm2 (still better than Tabby) and it’s a piece of cake and the description is in human readable format :


“Characters considered part of a word” - and I’ve added “!” 'cause I have strings that end in “!” and I just want to double click on the string to plonk it in the clipboard (iterm2 and Apple Terminal both do this by default - with middle click paste in a terminal - just like a real UNIX ).

What the F is this called in Linux?

If I search for “linux terminal double click string delimiter” I get lots a hits - but they’re convoluted and VERY VERY VERY F–KING “TL;lDR” like :

I aint got time to read all that shit… I just want a simple PLAIN ENGLISH HUMAN READABLE solution like iTerm2 provides on MacOS…

And there’s this - but I have no idea if this will work - and I DON’T want to be running scripts to do something that shouldn’t be so hard…

Oh well… Rant Over for the time being…

I’ll just keep using MacOS then…

Another right answer might be : “Well why not just start using Tabby in Linux then?” Because BY DEFAULT Tabby doesn’t treat “!” as a string delimiter :


Once again - something written in PLAIN ENGLISH in HUMAN READABLE format…

S0 - I answered my own question - don’t arse about with shonky things like dconf or shell scripts - JUST USE TABBY on Linux.
Note : I prefer iTerm2 on MacOS… but - I’m spoiled for choice and I use Tabby on some Windows systems I’m forced to use…

1 Like

Nice ranting @daniel.m.tripp

cheers mate - there’s nothing I enjoy more than a good rant, venting my spleen…

Well you actually exposed a big issue.
There is no universal definition of a string , neither the way the user writes it, nor the way it is stored in the computer.

  • in C strings can be written with doublequotes, but they are stored as a sequence of bytes ending in \n
  • in R strings can be written with single or doublequotes, but they are stored as a sequence of characters surrounded with double quotes
  • in Julia strings are not variables. They are immutable. Julia uses doublequotes
  • in rust there are 2 types of strings, one immutable, the other expandable. Rust uses a set of UTF8 bytes, a pointer and a length. No delimiters are stored.
  • in bash, everything is a string… there are no numbers… just strings of decimal characters.
  • in a gui… well I give up… copy and paste seems to be whatever you click on or drag over.

So if I want to take something out of a window, process it with a shellscript, read that output with C, then pass the C into R… I have to change string formats 4 times.

There is an argument for standards.

2 Likes

Nor is there a simple all encompassing single word to describe this!

I’m still niggly / triggered about this issue!

Note : I still haven’t figured this out in Gnome Terminal! What a steaming POS!

  1. MacOS Terminal
  2. iTerm2 for MacOS
  3. Tabby
  4. MobaXterm (have to edit MobaXterm.ini while MobaXterm’s not running - but relatively easy :
  [Misc]
  LeftDelimChars=!/~+-.&?$%
  MRightDelimChars=!/~+-.&?%

I decided I prefer using Gnome Terminal to Tabby a long time ago… it’s not a huge issue, but I prefer to not think about it - i.e. just double click the string and get it into the X select buffer (note MobaXterm automatically puts selected text into the Windows clipboard).

As previously mentioned I don’t want to wrangle with dconf editor or edit obscure files to enable this on Linux with Gnome Terminal (either Pop! or Ubuntu). Hmmm - if I ended up with a shell script to do it - all very well - I can live with that… But I don’t want to have to do this every time I rebuild my Linux desktop machines (which I do reasonably often enough, most builds only last 3 months)…


Decided to go the “reminder shell script” method :

───────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: delimit-gnome-termcrap.bash
───────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ #!/usr/bin/env bash
   2   │ # Gnome Terminal is a pile of crap... need I say more?
   3   │ # change the delimiter char - or in human form (e.g. iTerm2) : 
   4   │ # Selection -> Characters considered part of a word : 
   5   │ #     /-+\~_.!@?
   6   │ #
   7   │ BINFK="/usr/bin/dconf"
   8   │ STRINGFK='"/-+\~_.!@?-"'
   9   │ STRINGFK='@ms "-,.;/?%&#_=+@~·:"'
  10   │ echo -e "Your profile is probably in : "
  11   │ echo -e "\t/org/gnome/terminal/legacy/profiles"
  12   │ echo -e "e.g. : "
  13   │ echo -e "\t/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/"
  14   │ echo -e "\nYou can probably manually find this string first by using ZSH complete e.g. :"
  15   │ echo -e "\tdconf list /org/gnome/terminal/legacy/profiles:/:<TAB>"
  16   │ ###
  17   │ echo -e "\nThen do something like : "
  18   │ echo -e "\tdconf write /org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/word-char-exceptions $STRINGFK\n"
───────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

And output :

╭─x@titan ~/bin  ‹main*› 
╰─➤  ./delimit-gnome-termcrap.bash  
Your profile is probably in : 
	/org/gnome/terminal/legacy/profiles
e.g. : 
	/org/gnome/terminal/legacy/profiles:/:b1dcc9dd-5262-4d8d-a863-c897e6d979b9/

You can probably manually find this string first by using ZSH complete e.g. :
	dconf list /org/gnome/terminal/legacy/profiles:/:<TAB>

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

Except there’s something wrong with that syntax - probably the Gnome foundation moving the goal posts, which seems to happen a lot!

I just found this thread, and all this is a piece of cake, if you use konsole, the default terminal in KDE (I still don’t get, why anybody would use another desktop environment, but that’s a different story).

Selecting words by double-click is the default behaviour, other thing can be configured, just by clicking on “settings”.


Isn’t that, what you wanted?

There is always raw Xterm … with endless fiddling in .Xdefaults you can get something that is tolerable

I wonder are some of the things you want are best provided by choice of shell rather than terminal. Try something sophisticated like fish or nushell.

Everytime I’ve tried KDE - I kinda hated it and always ended up back in Gnome - I’ve tried it fairly recently too - KDE Neon maybe? Didn’t like it…

I use ZSH - I’d call it “reasonably sophisticated” (I also use it with “oh-my-zsh”)… Gnome Terminal dumbs me down a bit for sure, but I wouldn’t have a clue how to make xterm have a transparent background, I assumethat would also involve endless twiddling configuration files like .Xdefaults - no thanks :smiley: but thanks for the suggestion…

Really all I want is to be able to double click on a string of chars that contain “!” and “?” (and perhaps some other characters) and get the whole string (instead of having to drag select - note - most of the time - I’m using a keyboard with a trackpoint, and moving my hand to grab the mouse is a PITA and wastes seconds of my life :smiley: ).

I’m unhappy with Gnome - yes. Enough to switch desktops? No… If I was going to drop Gnome, I’d probably go for Pantheon (elementary) or XFCE, in preference to KDE.

Also - there’s the “kgx” version of “gnome terminal” which was going to be the default terminal going forward, but I read somewhere recently, the gnome foundation had moved the goalposts again, as is their wont, and habit - however kgx is even less configurable than the regular “Gnome Terminal”. Note also - way back when, I’m talking like 7 or 8 years ago - this feature (string delimiters) was a configurable in Gnome Terminal but they took it away! Why? It’s like when they removed the “configurable” in Nautilus/Files to let the user select / choose to have “slow double click” rename of files (which is everywhere else, i.e. MacOS Finder, MS Windows Explorer, Thunar).

2 Likes

Well Dan, in a way, I guess, we’re all maniacs. We love things to look and behave a certain way, and if they don’t, it drives us mad, especially if it used to be “the right way” at some point in the past.

1 Like

Have you tried terminal emulators… like Kitty or Aclaritty?
Dont replace the whole DE just to fix a terminal issue

Did just now… neither of them are “configurable” by menu options… I removed Kitty straightaway…

Tried various double click strings (e.g. with “!”) and default Alacritty doesn’t separate strings by “!” - however - nothing is configurable in Alacritty - e.g. not even opacity or transparency - I’ve gotten so used to transparency in terminals on MacOS and Linux, it’s something I can’t live without… It’s probably configurable by some obscure text file - but I want something that has menu options to configure it - it beats me why the Gnome “team” would take that option out!

Note : just found “terminator” has menu option to configure it - can change font, font size (I use 14), set transparency and “Select-by-word characters” option :

EXACTLY what I was looking for :smiley:

1 Like

Well done.
So you patch Gnome DE with Terminator
I might try that myself in Lumina DE… its terminal is worse than xterm!

1 Like

No need to - just install it from default Ubuntu (via Pop!_OS) repositories… Create a favourites in my bottom dock…

Unfortunately Pop! (from Ubuntu) doesn’t have an option to change the default terminal application - so if I want to launch a terminal in Nautilus / Files - I have to settle for Gnome Terminal…

I did try this :

sudo update-alternatives --config x-terminal-emulator

it let me select terminator :

╭─x@titan ~/X/10base2/Faves  
╰─➤  sudo update-alternatives --config x-terminal-emulator
There are 4 choices for the alternative x-terminal-emulator (providing /usr/bin/x-terminal-emulator).

  Selection    Path                             Priority   Status
------------------------------------------------------------
  0            /usr/bin/terminator               50        auto mode
  1            /usr/bin/alacritty                50        manual mode
  2            /usr/bin/cool-retro-term          40        manual mode
  3            /usr/bin/gnome-terminal.wrapper   40        manual mode
* 4            /usr/bin/terminator               50        manual mode

but after this, in Nautilus/Files - if I right click in a folder and “Open in terminal” it still launches Gnome Terminal - maybe logging out might fix that… not too bothered - I NEVER logout or reboot, or hardly ever, anyway…

1 Like

Looks like Nautilus is hardwired to gnome-terminal.
What would it do if you renamed gnome-terminal to some new name?

Afterthought:
Thst may not work. I think Terminator is dependent on gnome-terminal.

I’ve no idea if that’s the case or not… Nautilus should, ideally, “honour” what you’ve set as your default terminal application (it clearly does not - unless I need to logout or reboot to get Nautilus to acknowledge this).
I can live with launching Gnome Terminal in Nautilus…
I have one gripe with Terminator - and it’s trivial, and relatively minor, but, I miss the new terminal button in Gnome Terminal (and Gnome Console “kgx” application). Sure - I can just Ctrl+Shift+T to open a new terminal in a tab - but I’d rather just click a new tab button, like I can do in :

  • Gnome Terminal
  • Gnome Console (kgx)
  • iTerm2 (on MacOS)
  • MobaXterm (on MS Windows)

Didn’t see this in kiTTY or alacriTTY - but didn’t spend much time using them… As I mentioned - it’s a trivial niggle, I will live with it…

Another tiny niggle with Terminator - it’s not very friendly to people with visual disabilities (low vision and colour blindness) - it’s hard for me to differentiate between the tabs (the active one is obvious :

It’s obvious which one is the active one - but what happens when I’ve got 8 or more tabs open :


“murky” is how I’d describe that… Tried putting the tabs at the side, and the bottom, and it was even worser (sic) :smiley:

I guess there’s a whole bunch of other terminal apps I could try out like all those “quake” based ones like tilde, guage, yuaquake or whatever - but I’m done - I’ll settle for Gnome Terminal and Terminator for the time being… Just tried qterminal - it looked like something from the mid 1990’s - so quickly removed it…

1 Like

That is a real issue on the wider scene.
How does one ever know whether an app consults its config files every time you run it, or only at reboot.
It is worse in a VM… there seems to be a difference between a reboot and a shutdown, and doing it from the OS is not the same as doing it from virt-manager?

I agree - e.g. in VMware ESX - “reboot” and “shutdown -r now” seem to do different things… On more than one occasion I’ve seen instances where “reboot” hung or halted the system… To be safe I ALWAYS :
shutdown -h now (never “halt”)
or
shudown -r now (never “reboot”)

However I use reboot on my own systems all the time (well - on the odd rare occasions where I’m rebooting - don’t do it very often)…

2 Likes
╭─x@fenriz ~/MPZ/ThinLizzy/1983-ThunderAndLightning-APE  
╰─➤  ssh orenmwy "uptime"
 17:29:54 up 329 days,  3:38,  0 users,  load average: 0.37, 0.34, 0.32

orenmwy is my OrangePi 2E+ that runs Armbian 16.0 (you read that right - Armbian 16 is based on Ubuntu 16 - still occasionally gets updates too :smiley: ) - just sits there day after day - running Transmission Daemon beavering away at the queue, and accepting new torrents I paste into its Web UI…

Amazingly - this thing seems to be able to “weather” brownouts quite well… Nothing else in my house has such a long uptime… My Pi3B running TVHeadEnd definitely barfs on brownouts… Not that we’re particularly plagued with brownouts where I live - but I do sometimes wake up to find my Linux desktop machine, and my NAS, powered off (on both machines - somewhere in the BIOS I’ve set them to not power up again).

Go little orenmwy only another :

╭─x@orenmwy ~  
╰─➤  export UP=$(uptime |awk '{print $3}')
╭─x@orenmwy ~  
╰─➤  echo $(( $UP - 365))
-36

only thirty six days till 12 months uptime - I’m impressed! Go you little beast!

2 Likes