Skip to content

Instantly share code, notes, and snippets.

@rebane2001
Last active March 4, 2023 14:15
Show Gist options
  • Save rebane2001/81e3e7657bf29d6c67aa2c8c4403bcc4 to your computer and use it in GitHub Desktop.
Save rebane2001/81e3e7657bf29d6c67aa2c8c4403bcc4 to your computer and use it in GitHub Desktop.
Run a command in a new tmux pane in the same window (not sure about multiple sessions)
TMUX_WINDOW="$(tmux display-message -p '#I')"
function run_pane {
tmux split-window -h -t "${TMUX_WINDOW}" "$1"
# Wait for exit version:
# waitid="$(openssl rand -hex 16)"
# tmux split-window -h -t "${TMUX_WINDOW}" "$1; tmux wait -S ${waitid}"
# tmux wait "${waitid}"
}
# run_pane 'python3 verbose_script.py'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment