Show HN: Tmuxall – start a list of commands into 1 tmux session

1 points by bosky101 ↗ HN
$ cat commands.txt

    echo "any command you want to run"
    echo "on a different line"
    cd $HOME/dev/CH && clickhouse server
    cd $HOME/dev/CH && clickhouse client
    tail -f some/log
    cd some/path && docker-compose up -d
    psql
$ cat ./tmuxall

    #!/bin/sh
    tmux new-session -d -s $USER
    while read cmd
    do
    echo $cmd
    tmux send "$cmd" ENTER;
    tmux split-window;
    done < $1
    tmux a
Make it executable

    $ chmod +x ./tmuxall

Usage (after you have installed tmux)

    $ ./tmuxall commands.txt
Screenshot here

    https://i.ibb.co/JBjsXKk/Screenshot-2024-02-22-at-11-46-44-AM.png

0 comments

[ 3.1 ms ] story [ 9.8 ms ] thread

No comments yet.