Plugin that performs actions on matched text
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Terminator |
In Progress
|
Wishlist
|
Wesley |
Bug Description
Hi,
I have used iTerm2 on OS X before and it has a 'trigger' feature, where the terminal will monitor output for a given string (or regex) and the user can set an action to occur once that string is printed to the terminal output. The action could be inputting text to the terminal, notifying the user, etc.
I wrote a quick proof-of-concept of this plugin, which works well.
It appears to me that in order to enable it, it must be 'checked on' as a menu item at the start of each new terminator session.
It would be nice if this type of plugin could be enabled by as soon as terminator starts.
I was able to accomplish this functionality by executing the callback in 'terminator.py' right before the main loop begins.
Is this (either the plugin itself or the ability to have plugins that begin on startup) something that maintainers would consider adding into the main code?
Thanks!
Hi Wesley. Definitely something I think would be an interesting addition. Obviously I don't know how you've implemented this, so I'd have to see the code to give more thoughts or opinions. Just a few quick thoughts that occur to me:
Does this only match output, or input too? i.e. Can I sound a big siren if I type "rm -rf" before I hit return? Perhaps it could even be a primitive auto-correct if it could insert backspace chars.
Is this a basic string match or a regex match? A regex would allow passing matched groups to the input/notificat ion/external command/etc as arguments.
Whats the performance like with infinite scrollback and/or lots of terminals?
I'd be wary of having this active for all terminals by default. Perhaps it could be tied in to Profiles somehow, so that strings are only checked/matched in terminals that are running a particular Profile.
I recommend you to push your branch to Launchpad. Then I and others can take a look and play around with it.