

the command may set variables or source a script or you want to be able to interrupt watch and have it in the shell history. Running a shell command with send-keys like you do in your script makes sense if the command affects the shell it runs in and your goal is to work interactively in the shell prepared this way. Your shell commands ( watch) can work indefinitely, so you may not need such tricks. An alternative is the remain-on-exit option. It includes bash at the end, so the pane doesn't exit when the actual command ( echo) finishes. In the example script echo "step 0" bash is such shell command. Any(?) tmux command that creates a new shell inside tmux can run a shell command instead.

In general do not use send-keys to run commands. I do not use send-keys to run commands.Tmux send-keys 'watch -n1 $, I use the token.

Tmux send-keys 'watch -n1 "cat /proc/cpuinfo | grep "MHz" | sort -r | tail -32"' C-m Tmux send-keys 'watch -n1 "cat /proc/cpuinfo | grep "MHz" | sort -r | head -32"' C-m Here is what I have been able to achieve:Īnd here is the shell script I got working: #!/bin/bash There is no error or warning thrown, but it seems my requests are simply ignored. It seems to me that some layouts are simply not allowed. I spent quite a bit of time messing around with tmux recently, and cannnot figure out what I am doing wrong.
