I often have to run a command in multiple panes, for example when editing
my .bashrc settings, or other change I want applied to all panes. I found a
neat script for doing this: https://gist.github.com/2773454

The script relies on send-keys and seems to work well in many cases.
Unfortunately, in some panes this causes a bug (it's inconsistent, so I'm
still unsure why it's happening), where the pane tries to execute "ull"
command instead, which doesn't exist, causing bash to complain. My guess is
it's the last 3 characters of the 'tmux send-keys "$command && fg
2>/dev/null" C-m' line from the script, which for some reason are getting
cut off and sent individually (could it be that the string is too long for
the tmux send-keys buffer?). To remedy this, I figured I'd use run-shell
instead.

In the past, I've used run-shell command instead, which has several
advantages over send-keys (it doesn't need to suspend the process, and it
doesn't need to send command as a set of keys, making it work much faster).
Unfortunately, in this case, that command causes all output to happen in
the original pane that ran this script, despite the 'tmux select-pane -t
$pane' command that should be switching the target pane. Is this a bug? Am
I doing something wrong? I would have thought if I select a different pane,
run-shell command is now tied to that new pane rather than the original
pane the process is running from. If not, is there a way to bypass that? I
don't mind using send-keys if I can figure out why the 'ull' bug is
occuring and fix that, but I would much rather prefer if I could modify
this script to use run-shell, this way not only I don't have to deal wtih
that bug, but I don't have to suspend the process, which introduces other
problems as well (for example my vim, which is tied to my version control
system, sometimes asks me if I'm sure I want to edit the file after I
resume it from suspend). If this is a limitation of run-shell, do you guys
think it would be a good idea to have 'run-shell -t <pane> <command>'
option? If so, I could look into adding it myself.
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to