Skip to content

fix(cli): Windows final-mile cleanup — clipboard auto-clear + hook docs (closes #9, #10)#44

Merged
MasonStation merged 2 commits intomainfrom
fix/windows-final-mile
Apr 26, 2026
Merged

fix(cli): Windows final-mile cleanup — clipboard auto-clear + hook docs (closes #9, #10)#44
MasonStation merged 2 commits intomainfrom
fix/windows-final-mile

Conversation

@MasonStation
Copy link
Copy Markdown
Contributor

Summary

Closes the two remaining functional issues on the Windows tracker (#1):

  • cli: replace bash -c 'sleep && pbcopy' clipboard auto-clear with pure Rust #9phantom reveal --copy no longer shells out to bash -c 'sleep 30 && pbcopy' for the auto-clear. Replaced with a self-respawn of a hidden phantom __clear-clipboard-after --secs N subcommand that sleeps and clears via arboard. Cross-platform, no shell, preserves the immediate-exit UX of the original (a thread would die when the parent exits, and on macOS/Windows the clipboard persists past process exit — so a live process is needed).
  • init: make pre-commit hook work under native Windows git #10 — adds a Windows pre-commit hook caveat to the README. The installed #!/bin/sh hook works under Git for Windows' bundled sh.exe (the standard installer ships it). GUI clients with a stripped PATH may silently skip it; recommends terminal commits or phantom check --staged, and notes CI as the durable safety net.

After this lands, the only open child of #1 is the umbrella tracker itself — Windows is functionally complete.

Test plan

  • cargo build — clean
  • cargo clippy --all-targets -- -D warnings — zero warnings
  • cargo fmt --check (on changed files) — clean
  • cargo test --workspace — all pass except a pre-existing keychain-state-pollution flake unrelated to this change
  • phantom __clear-clipboard-after --secs 1 runs and exits 0
  • phantom --help does not list the hidden subcommand
  • Manual: phantom reveal --copy SOME_KEY returns the prompt immediately, clipboard clears 30s later (Windows + macOS)

🤖 Generated with Claude Code

Closes #9: replace the macOS-only `bash -c 'sleep && pbcopy'` shell-out
in `phantom reveal --copy` with a self-respawn of `phantom
__clear-clipboard-after`, a hidden subcommand that sleeps the requested
seconds and clears the clipboard via arboard. Spawning a child rather
than a thread preserves the original UX (parent exits immediately) and
works on Windows where there's no bash. The new subcommand is hidden
from --help.

Closes #10: document the pre-commit hook caveat in the README's Windows
section. The installed `#!/bin/sh` hook works under Git for Windows'
bundled sh.exe (the standard installer); GUI clients with a stripped
PATH may silently skip it. Recommends terminal commits or `phantom
check --staged` as the workaround, and notes CI as the durable safety
net regardless.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Apr 26, 2026 5:40pm

Request Review

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@MasonStation MasonStation merged commit e1d83ed into main Apr 26, 2026
6 checks passed
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.

1 participant