fix(tmux): background the project-accent session-created hook#210
Merged
Conversation
The session-created hook ran project-accent.sh via a foreground run-shell, which blocks tmux's command queue while the script forks bash plus several tmux subprocesses. During `tmuxinator start`, that work landed on the command queue's critical path just as the project's panes were spawning their shells, adding shell-startup contention. Add `-b` so the hook runs in the background, off the critical path. The script's own `refresh-client -S` still repaints the status bar, so the accent continues to appear immediately on new sessions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
session-createdhook with a foregroundrun-shell, which blocks tmux's command queue while the script forksbashplus several tmux subprocesses — landing on the critical path exactly astmuxinator startspawns a project's 4–5 pane shells, adding shell-startup contention.run-shell -bso the accent work runs off the command-queue critical path. The script's ownrefresh-client -Sstill repaints the bar, so the accent continues to appear immediately on new sessions.Changes
tmux/.config/tmux/project-accent.tmux: add-bto thesession-createdhook'srun-shell, and expand the inline comment to explain why it's backgrounded.Testing
-L accent-test, separate from live sessions): hook definition is nowrun-shell -b …; a mapped session (bfo1) receives@accent = #93db29via the backgrounded hook in ~50–100ms — no paint regression; an unmapped session falls back to the theme default../scripts/lint-shell— 42 scripts pass../scripts/run-tests— 79 bats tests pass.job-queuetimeout spam (validated over time in actual use, not from a single run).Notes
refresh-clientloop when unmapped" tweak — the local accent map covers every session actually run, so the unmapped branch never fires; it would add a conditional plus a stale-paint edge case for no real benefit. Left the config-source backfill (line 27) in the foreground — out of scope and off the session-creation critical path.job-queuespam can only be confirmed across real launches. If it recurs, next steps are theabbr-queue-clearhelper (feat(zsh): add abbr-queue-clear helper for a stuck zsh-abbr job queue #209) and instrumenting withJOB_QUEUE_DEBUG=1.Closes #208