So I just created a bunch of panes in detached mode. Now I'd like to put a clock in the second pane (pane number 1).
here's my code:
tmux new-session -d -s ssh_tmux tmux splitw -v -p 30 -t ssh_tmux:1.0 tmux splitw -h -p 60 -t ssh_tmux:1.1 #required; otherwise pane numbering is bs tmux select-pane -t ssh_tmux:1.0 tmux splitw -h -p 30 -t ssh_tmux:1.0 tmux send-keys -t ssh_tmux:1.2 htop Enter tmux send-keys -t ssh_tmux:1.1 'tmux clock' Enter tmux a -t ssh_tmux
The problem is that, while 'tmux clock' is entered in the correct pane, the clock is actually displayed in the active pane. The only workaround I've been able to find is to set
ssh_tmux:1.1 as the active pane, create the clock with
send-keys, send a
sleep of >0.1s (0.2 worked, 0.1 wasn't enough), and then set
ssh_tmux:1.0 as the active pane.
That workaround kind of sucks. Surely there's something better?