tmux: how to bind a key to launch shell command?
The right answer to this question is: use bind-key
, e.g.:
tmux bind-key "$KEY" run-shell "/path/to/script.sh"
where KEY=C
in your case.
C-b c
already has a standard binding which it might be wise to leave unchanged. Choosing another character, eg C-b C you can setup a binding in your
~/.tmux.conf
file as follows:
bind C send-keys -t.- 'mvn install' Enter
The -t.-
means "the other pane". Enter
stands for the key of that name, i.e. the newline at the end of the command.