Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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?

share|improve this answer
add comment

Your Answer

 
discard

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.