tmux-copycat icon indicating copy to clipboard operation
tmux-copycat copied to clipboard

Ignore $PROMPT text in backward searches

Open bedge opened this issue 7 years ago • 2 comments

My prompt matches both path and numeric seaches:

 29/10/18 07:40:54 ~ 🐍 p3 
❯

I use this for auditing purposes, along with logging.

While it would be possible to introspect the $PROMPT/$PS1 and figure out what to ignore, I'd be happy with being able to specify a regex to ignore as well. In fact, that may provide better flexibility for unforeseen use cases.

bedge avatar Oct 29 '18 14:10 bedge

Seconded - the fact that copycat doesn't at bare minimum have a configuration for this makes it pretty unusable for me with a prompt like 01-16 10:39 > ~/Doc…/code/ which matches both the file and number patterns

micimize avatar Jan 16 '19 16:01 micimize

Stumbled on this... Would love to see this builtin tmux.

For context, my prompt is something like (consider I'm on ~/workspace/my-projects)

⋊> ~/w/my-projects/ 

And I have the following pattern in my tmux config, for grepping for filenames in my pane. It unfortunately matches my prompt as well and I couldn't manage to fix yet...

bind C-f copy-mode \; send -X search-backward "(^|^\.|[[:space:]]|[[:space:]]\.|[[:space:]]\.\.|^\.\.)[[:alnum:]~_-]*/[][[:alnum:]_.#$%&+=/@-]*"

Drowze avatar Dec 07 '23 15:12 Drowze