Allow smart select to optionally highlight only capture group(s), not entire bounds
By shab... on August 29, 2014 18:35 (imported from Google Code)
It appears that after a completed smart selection match, the visual highlight in the terminal panel includes the entire regex match (\0).
For some patterns, especially ones that are anchored to ^..(...)..$, this marks the whole line as selected (and is what gets copied with cmd-C)
Whilst it's possible to define a custom action that calls 'echo \1 | pbcopy' or similar, it would be nice to have the ability to configure smart select matcher entries with an 'on match, visually select group: ' with default of bounds(\0), and options for either first or any matching groups.
Even just a \0 or \1 choice would be a useful feature, since you can exclude prefix or suffix parts that you don't care about.
My exact use-case is matching shell prompt lines that use a RPROMPT to display the return value of the previous command, so the input is something like:
$ echo last-succeeded
$ echo last-failed 130 ✘
and I wish to strip the leading $ and trailing return info when visually selecting.