Add a way to define custom actions associated with regular expression matches in terminal output
So let me give you the vision I have, with a specific use-case. Imagine you have the ability to specify a regex that will highlight text in the terminal output, the way file paths and web addresses are highlighted now. One way to use this would be to highlight git SHA's. Now, imagine that clicking on these highlighted SHA's would give you a menu, and that you could define the items in the menu and a terminal command with simple substitution for each one. For example,
"Log": git log $1
"Rebase on top of": git rebase -i $1
With this syntax, $1 would be the highlighted text. You could imagine extending this to allow capture expressions within the regex, as well, though I think you could get a long way with just this basic feature.
I'd find this very useful. What do you think? Is this feature something that you'd want in iTerm2?
I'd actually be willing to write the patch, but I'm not familiar with the iTerm2 source code, so if I do it I'd appreciate a bit of mentoring (which files/methods would need to be changed, that sort of thing).