docs: silence background job output in shell integration snippet#29
Open
eni9889 wants to merge 2 commits into
Open
docs: silence background job output in shell integration snippet#29eni9889 wants to merge 2 commits into
eni9889 wants to merge 2 commits into
Conversation
Wrapping `claude-sync pull -q &` in a subshell `(cmd &)` detaches the background job from the parent shell's job table, so interactive shells no longer print `[1] 12345` on start and `[1] + done` on completion every time a terminal is opened.
There was a problem hiding this comment.
Pull request overview
Updates the README’s shell-integration snippet to avoid interactive job-control noise when claude-sync pull is launched in the background on shell startup.
Changes:
- Runs the background
claude-sync pull -qinside a subshell and redirects output to suppress job-control messages and stray output. - Adds an explanatory note describing why the subshell pattern is used.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses Copilot review feedback — docs/how-it-works.md had the same shell integration snippet and was missing the same fix.
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
Tiny README tweak. The current shell integration snippet recommends:
In interactive zsh/bash, the trailing
&causes the shell to print job-control messages every time a terminal is opened:These two extra lines per shell start are harmless but visually noisy — especially with a prompt that renders a separator line.
Fix
Wrap the background call in a subshell so the job is detached from the parent shell's job table:
The pull still runs in the background; the parent shell just never tracks it, so no
[N] PIDstart line and nodonecompletion line are printed. Redirecting stdout/stderr also keeps any stray output from leaking into the prompt.Verified locally on macOS zsh 5.9 — terminal opens clean,
claude-sync pull -qstill runs (visible inps).Test plan
[N] PIDor+ donelines appearclaude-sync pullstill executes (ps aux | grep claude-syncduring shell start, or check sync state after)