Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Issue with URxvt.selection.pattern-N [SOLVED]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1816

PostPosted: Thu Jul 21, 2022 2:22 pm    Post subject: Issue with URxvt.selection.pattern-N [SOLVED] Reply with quote

I'm not sure this belongs here since it's surely not a Gentoo issue specifically. That aside: I'm trying to make modifications to the behavior of the double click selection in the urxvt terminal using this:

https://linux.die.net/man/1/urxvt-selection

The default behavior for the first double click is to select the word under the cursor. I wanted to change that to select all non-whitespace and have tried this:
Code:
URxvt.selection.pattern-0: ([\\S]+)
One reason was that I'd like to be able to double click things like URLs and get all of it. However the above, for whatever reason does NOT include the ampersand (&). So far nothing I try, for example:
Code:
URxvt.selection.pattern-0: ([\\S\\&]+)
...corrects this. Am I missing something there? Seems pretty straight forward.

Thanks in advance!
Tom


Last edited by tld on Fri Jul 22, 2022 10:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1816

PostPosted: Thu Jul 21, 2022 6:38 pm    Post subject: Reply with quote

Wow. This just doesn't seem to be possible. I was suspecting that the urxvt "cutchars" might be related, but nothing I've tried seems to help.

That URxvt.selection.pattern-0 clearly IS affecting the selection, but for whatever reason refuses to include the ampersand. Odd beyond words.

Tom
Back to top
View user's profile Send private message
trilithium
n00b
n00b


Joined: 18 Nov 2019
Posts: 43

PostPosted: Fri Jul 22, 2022 9:12 pm    Post subject: Reply with quote

The selection extension matches against a set of regular expressions and shows the matching strings in increasing order of length upon double-click and further clicks. It does not allow you to remove any of the built-in regular expressions, you may only add to the set using URxvt.selection.pattern-0 etc.

The shorter matches excluding ampersands you are seeing are from those built-in regular expressions. On my setup (\S+) seems to work fine for selectings URLs including ampersands – but I have to triple-click.

It is a simple Perl extension so you should be able to adapt it for your purposes. You probably only need to remove the offending expressions from @mark_patterns.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1816

PostPosted: Fri Jul 22, 2022 10:43 pm    Post subject: Reply with quote

Ahhh...Thanks. That explains a lot. Actually I'm seeing the exact behavior you describe with the triple click, which I hadn't realized before. That's actually pretty good as-is. With the default setting I could only select including the "&" with a triple click, but that one included things like the newline at the end of the current line. With the \S pattern it takes four clicks to include the new line.

You're probably correct, that it wouldn't be too tough to get rid of whichever default pattern causes that, but I'm pretty OK with the way it is. Thanks!

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum