tmux-python / tmux-python/tmuxp
Tmux session is killed when `before_script` fails while using `--append`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 248
- Avg merge
- 2h 13m
- Merged PRs (30d)
- 1
Description
Let me first thank you for this amazing tool! Running tmuxp load has quickly become the very first thing I do when I return to a project.
However, I've noticed the following rather annoying bug.
Let's say we have the following workspace file .tmuxp.yaml.:
session_name: foo
before_script: /bin/false
windows:
- window_name: bar
panes:
- date
When we create a tmuxp session with tmuxp load .tmuxp.yaml it errors out as expected:
tmuxp.exc.BeforeLoadScriptError: before_script failed with returncode 1.
command: /bin/false
Error output:
So far, so good. However, if we first create a Tmux session with a couple of windows:
tmux new-session -d -s dev -n first_window
tmux new-window -t dev -n second_window
tmux new-window -t dev -n third_window
tmux attach -t dev
and then create the tmuxp session with the --append flag: tmuxp load --append .tmuxp.yaml, I get only [exited] as output, and my entire Tmux session (including existing windows) is gone.
Hopefully you can reproduce this. Thanks again for tmuxp!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the tmuxp load --append entry point and the handling of before_script failures. Reproduce the issue using the .tmuxp.yaml example and the listed tmux commands; done means the failure still reports the error while the existing session and windows remain intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100