
On 18/05/13 11:13, Duncan Roe wrote:
On Fri, May 17, 2013 at 01:05:55PM +1000, Toby Corkindale wrote:
On 16/05/13 13:50, Matthew Cengia wrote:
On 2013-05-16 12:27, Toby Corkindale wrote:
I just wondered.. are there any terminals*, plugins for terminals, or plugins for tmux, that will scan output and automatically send canned responses -- whilst still letting me interact normally the rest of the time?
And secondly -- are there any tools that will simply let me assign hotkeys or macros to be automatically typed upon being pressed?
That latter request seems simple, but I didn't get much joy when searching online for likely packages.
I can't speak for tmux, but for screen, I do things like the following in my .screenrc:
## Fancy regexp to grep out blank lines and comment lines bind ^g stuff '"^[[:space:]]*(#|$)"'
Which says "when I hit the screen escape key followed by ctrl+g, type "^[[:space:]]*(#|$)" (including quotes) into my current screen window.
Tmux may have an equivalent to this, assuming this is the sort of thing you're looking for.
Thanks - this totally covers one of the two things I was looking for. I can add to .tmux.conf:
bind-key C-h send-keys -l "hello world!\n" ^^^^^^^^
Hi Toby,
What is send-keys? I couldn't find it on Google.
It's present in my version of tmux (1.7), from the man page: send-keys [-lR] [-t target-pane] key ... (alias: send) Send a key or keys to a window. Each argument key is the name of the key (such as ‘C-a’ or ‘npage’ ) to send; if the string is not recognised as a key, it is sent as a series of characters. The -l flag disables key name lookup and sends the keys literally. All arguments are sent sequentially from first to last. The -R flag causes the terminal state to be reset. cheers, Toby