4 ms·
Nice, I had no idea you could script tmux like that! Reminds me of "expect", which I've used to automate interactive SSH sessions with network devices.
by GordonS 7y ago
Nice, I had no idea you could script tmux like that! Reminds me of "expect", which I've used to automate interactive SSH sessions with network devices.
- tyingq 7y agoReplacing the sleeps with calls to "tmux capture-pane" to parse the responses would be closer to expect.
- 3xblah 7y agoBrainless method I use to check the panel: case $1 in ""|-b|-E|-S|-t) tmux capturep $@ --; tmux showb $@ --; exec tmux dele --; esac Also there is a "-N repeat count" option for send-keys in newer versions of tmux.
- abcdef123xyz2 7y agocapture-pane has -p so you can pipe its output rather than letting it create a buffer you have to delete.
- 3xblah 7y agos/has/now &/ I started using tmux in 2009. There was no -p option when capturep command was first added. Old scripts that keep working tend not to get updated. I have updated it now. Thank you.