Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
I think the double-click mouse action will select a whole word (string of characters without spaces on it), so on your example, double-clicking will definitely select the entire string even with the "/" on it. / is not a separator, the space is. – Peachy Jul 27 '12 at 1:17

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.

share|improve this answer

You can fix this for xterm, on the manual page the option is "Character Classes" (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)


    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?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.