3

When I double click /This/is/a/directory it selects the whole string. It should only select the word I click. eg. if I double-click "This" then only "This" is selected.

This is how Ubuntu used to work a couple of versions previous. It has caused me endless frustration. It does this in both xterm and terminal.

Can anyone please help me out?

2 Answers2

2

In gnome-terminal you can change it from the menu: Edit > Profile Preferences > General > Select-by-word-characters. Remove the "/" and it's done.

The menu is at the top of the screen now for every application, and it's invisible until you move your mouse there. Instead of using that global menu, you can also right-click anywhere in gnome-terminal and change the profile from there.

elmicha
  • 9,960
1

You can fix this for xterm, on the manual page the option is "Character Classes" http://linux.die.net/man/1/xterm (link for reference, don't worry I'll step through the changes)

  1. Create a file in your home folder (your user name folder) called .Xdefaults (caps matter) (If it allready exists open it)

  2. In the file put this (at the end if it information exists already)

    XTerm*charClass:
    33:48,37:48,45-46:48,38:48
    

    Then save the file. This Associates characters as "word" characters 48 so for each character you want to be in a word like ' for don't. this combination excludes character 47 in the table from the manual so / is not associated as part of words.

  3. Next we need to apply the changes, Navigate to your home folder in terminal (should be the default in opening a terminal with alt+ctrl+t

  4. Run this in terminal

    xrdb -merge .Xdefaults
    

    That should have done it, now run xterm to find out(may need to restart after that).

For gnome-terminal this question might help What are "select-by-word" characters?

Mateo
  • 8,152