6 ms·
one of my favorite tmux patterns is "kill it if its running and run it again somewhere else" which uses send keys in a bash script. I'm always knocking up scrip
by mjbrownie 7y ago
one of my favorite tmux patterns is "kill it if its running and run it again somewhere else" which uses send keys in a bash script. I'm always knocking up scripts like this
#!/bin/bash
TMUX_SESSION=test
TMUX_WINDOW=QUICK_TEST
# your custom command you want run
COMMAND=~/bin/quick_test
ARGS=$*
tmux kill-window -t $TMUX_SESSION:$TMUX_WINDOW
tmux new-window -t $TMUX_SESSION -n $TMUX_WINDOW
tmux send-keys -t $TMUX_SESSION:$TMUX_WINDOW"$COMMAND $ARGS" C-m
run the script in the terminal/ide you're working/editing. it blinks away on another screen (or another machine entirely eg. raspberry pi monitor in the kitchen) without disrupting your main task.