Skip to content

docs: silence background job output in shell integration snippet#29

Open
eni9889 wants to merge 2 commits into
tawanorg:mainfrom
eni9889:docs/silence-bg-job-output
Open

docs: silence background job output in shell integration snippet#29
eni9889 wants to merge 2 commits into
tawanorg:mainfrom
eni9889:docs/silence-bg-job-output

Conversation

@eni9889
Copy link
Copy Markdown

@eni9889 eni9889 commented May 12, 2026

Summary

Tiny README tweak. The current shell integration snippet recommends:

if command -v claude-sync &> /dev/null; then
  claude-sync pull -q &
fi

In interactive zsh/bash, the trailing & causes the shell to print job-control messages every time a terminal is opened:

Last login: Mon May 11 21:18:11 on ttys009
[2] 17215
❯
[2]  + done       claude-sync pull -q
❯

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:

(claude-sync pull -q &) >/dev/null 2>&1

The pull still runs in the background; the parent shell just never tracks it, so no [N] PID start line and no done completion 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 -q still runs (visible in ps).

Test plan

  • Open a new interactive zsh/bash shell with the updated snippet — no [N] PID or + done lines appear
  • Confirm claude-sync pull still executes (ps aux | grep claude-sync during shell start, or check sync state after)

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.
Copilot AI review requested due to automatic review settings May 12, 2026 01:21
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -q inside 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.

Comment thread README.md
Addresses Copilot review feedback — docs/how-it-works.md had the
same shell integration snippet and was missing the same fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants