Feature request: on_project_kill event
Is your feature request related to a problem? Please describe.
Hi! I love tmuxinator, but I have a rather off-spec way of using it. I like creating shebanged executable .tmux.yml files so I can have several launchers for different deployments of the same tools.
I would love an on_kill event the same way a on_project_start exists. I have this global shortcut <prefix>X that is bound to tmux kill-session which I use all the time for both tmuxinator and plain tmux.
There is already an on_project_exit, but it is not enough for me as I usually detach and reattach to sessions. As a side note, a better name for it would be on_project_detach so its intent is clear IMO.
Also on_project_stop does not respond when a session is killed (unless I'm doing something wrong).
Describe the solution you'd like
A YAML-supported on_project_kill entry.
Describe alternatives you've considered
I typically hook this up like this, which is fragile, relies on the session name and hinders readability of on_project_start:
#! /usr/bin/env -S tmuxinator start -p
# chmod +x me!
name: my_session
on_project_start: |
# Startup tasks
rm -rf /tmp/out/*
# Cleanup hook install
nohup bash -c "
until tmux has-session -t my_session 2>/dev/null; do sleep 1; done;
while tmux has-session -t my_session 2>/dev/null; do sleep 2; done;
docker container kill foo
" >/dev/null 2>&1 &
windows:
- main:
layout: even-horizontal
panes:
- docker run -it --name foo bar
- sleep 5; ./curl
- watch ls -lh /tmp/outAdditional context Add any other context or screenshots about the feature request here.
Thank you :)
Source: tmuxinator/tmuxinator