Repository navigation
Conversation
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
The git HEAD watcher polls once per second in every pane whose shell is inside a git repository. Reading HEAD through $(...) forked a subshell on each poll, so many open panes caused a steady stream of process launches. Return the signature through REPLY, as the tmux env signature already does. Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Thanks for opening your first cmux pull request! We're a small team and the outside-PR queue is long, so a reply can take a while, sometimes longer than we'd like. If this one goes quiet and you'd like eyes on it, comment here and we'll pick it up. A few things that help:
|
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
There was a problem hiding this comment.
🟡 Changes recommended
Read failures can terminate ERR_EXIT watchers, and the new regression test is not registered for CI execution.
2 open findings
What changed in this PR
Removes per-poll zsh subshell creation from the Git HEAD watcher.
Changes:
- Adds a
REPLY-based HEAD reader while preserving the printing wrapper. - Adds regression coverage for watcher process reuse.
| File | Description |
|---|---|
Resources/shell-integration/cmux-zsh-integration.zsh |
Reads HEAD without command substitution. |
tests/test_zsh_git_head_watch_no_fork.py |
Verifies polling occurs in the watcher process. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Restore the || true guard so a missing or unreadable HEAD cannot abort an ERR_EXIT shell, and register the no-fork regression in the macos-cli-no-socket lane. Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
|
I have read the CLA Document v2.2 and I hereby sign the CLA |


Summary
Each pane whose shell is inside a git repository runs a git HEAD watcher that polls once per second while a command is in the foreground. The poll read HEAD through
$(_cmux_git_head_signature ...), so every poll forked a subshell. With many panes open this adds a steady stream of short-lived processes, roughly one per pane per second, even when nothing is happening.The watcher now reads HEAD with
_cmux_git_head_signature_into_reply, which returns the value throughREPLYlike_cmux_tmux_shell_env_signature_into_replyalready does, so the loop no longer forks._cmux_git_head_signaturekeeps its printing interface as a thin wrapper for existing callers. Branch-change detection is unchanged, and the reads stay status-neutral (|| true) so a missing HEAD can't abort anERR_EXITshell.Testing
tests/test_zsh_git_head_watch_no_fork.py. It starts the real watcher loop and records the PID that performs each HEAD read.0f52094b74): fails,3 of 3 HEAD polls ran in a forked subshell.f09de881ff): passes,git HEAD watcher polled 3 times without forking.f09de881ff:test_issue_15066_zsh_watcher_sleep.py,test_issue_10926_watcher_pid_reuse_guard.py,test_shell_no_git_watch.pyandtest_shell_git_branch_stale_cwd.py.macos-cli-no-socketlane;validate_test_execution_registry.pypasses.python3 scripts/verify-local.py: 17/17 checks passed. This is a shell-script-only change, so I didn't run a native build or test it live in a tagged build.Changelog
Changed: The zsh git branch watcher no longer starts a new process every second in each pane
Proof
Not user-visible. The sidebar's branch and PR updates behave the same; only the per-poll process launch is gone.
Checklist
Need help on this PR? Tag
@codesmith-botwith what you need.Summary by CodeRabbit