thestinger / termite

Termite is obsoleted by Alacritty. Termite was a keyboard-centric VTE-based terminal, aimed at use within a window manager with tiling and/or tabbing support.
https://github.com/alacritty/alacritty
2.73k stars 240 forks source link

Regex based click actions? #656

Closed cgathuru closed 5 years ago

cgathuru commented 5 years ago

Hi,

Would it be possible to have regex based click actions? i.e. if this regex matches then clicking on it would call the given program that is specified. This works for URLs at the moment. You can click on a url and it will open in the browser.

A URL I assume is detected based on a regex which when found would invoke the browser passing the given match. It would be great if it was possible call a different program/script with the matched regex.

As a example if there was the text "Bug 679658" or for simplicity then clicking on it would invoke a script that say would say open eventually create a like like https://bugzilla.gnome.org/show_bug.cgi?id=679658 and open that in the browser, or search in google/wikipedia etc.

klarinetkid commented 5 years ago

If you look at browser_regex.hh you can see where all that is defined, and see where it is used in termite.cc. you could go in and add some similar code

jelly commented 5 years ago

I'm not interested in implementing this usecase for urls you can already replace the browser command by a bash script which inspects $1 and then executes what you want.

jelly commented 5 years ago

Closed since no response.