[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xterm double-click to select words like "cups-bsd", "/var/log"



On Sat, Mar 20, 2004 at 02:53:30PM -0500, Gregory Seidman wrote:
> Some of us prefer this behavior, but it is configurable. You need to get
> the following X resource to be noticed by xterm:
> 
> XTerm*charClass: 0-32:1,33-126:2,127-160:3,161-255:2
> 
> There are many ways of going about it, but the simplest is to put it in
> you ~/.Xdefaults (or maybe it's ~/.Xresources; I forget which is
> standard these days) and run xrdb -load ~/.Xdefaults somewhere in your
> .xinitrc (or whatever else you use for starting X). Another option is to
> put it on xterm's commandline:
> 
> xterm -xrm "XTerm*charClass: 0-32:1,33-126:2,127-160:3,161-255:2"
> 
> If you want to understand what's going on, read the CHARACTER CLASSES
> section of the xterm man page.
> 
> --Greg



I thank Rebecca Dridan and Gregory Seidman for both telling
how to extend the character set highlighted when double-clicking
the mouse.

Summarizing, to extend the character set,
I could use any of the following after  "xterm",
   -xrm "XTerm*charClass: 33:48, ..."
   -xrm "*charClass: 33:48, ..."
   -cc  "33:48, ..."
I use
   -cc  33:48,37:48,45-47:48,64:48,92:48,126:48
Here, -cc signals that double-clicking the mouse
adds to the regular character class
(see  "man -S 7 ascii"  or enter  "ascii"  
if you installed the package "ascii") 
those characters with decimal values
   ! (33)
   % (37)
   - (45)
   . (46)
   / (47)
   @ (64)
   \ (92)   
   ~ (126)  
The above -cc  adds each character to the character class 48 
[an arbitrary default category for mouse double-clicking in xterm],
which includes other characters like a-z, A-Z, and 0-9.
See  "man xterm"  78 percent down under  "CHARACTER CLASSES"
for xterm's default character class numbers like "48";
although my   "man xterm"  brings up  "man uxterm";
so you can  "man -a xterm",  "q",  then "return",
to see what should be  "man xterm".
   
I also use the xterm option
   -cn
so newlines are not included in a mouse double-click.

I extended my "xterm" based function (like an alias) "xtm" 
in ~/.bashrc to include -cc,
 function xtm() {
    xterm -sb -sl 3000 -j -si -sk -cn  -fg yellow  -bg black  -cr red \
       -ms cyan -geom 100x40 -fn 7x14  \
       -cc 33:48,37:48,45-47:48,64:48,92:48,126:48  \
       -xrm xterm.vt100.pointerColor:blue  \
       -xrm xterm.vt100.pointerColorBackground:yellow  \
       -xrm xterm.vt100.pointerShape:gumby &
 }
Notice that I like a mouse pointer of "gumby",
so gumby's right finger points directly to a character when I
double-click, unlike most other mouse pointers.
Also notice that this xterm has gold characters on a black background,
like many of the standard monitors 30 years ago.
An retired fortran expert from an age without new fangled colors 
mentioned that now one can never decide what infinite color scheme is best.

Thank you Debian users for making my Linux mouse more useful.

--Jim 

Attachment: signature.asc
Description: Digital signature


Reply to: