Skip to content

cli: replace bash -c 'sleep && pbcopy' clipboard auto-clear with pure Rust #9

@MasonStation

Description

@MasonStation

phantom reveal --copy schedules a 30-second clipboard clear by shelling out to bash -c "sleep 30 && echo -n '' | pbcopy". Does not exist on Windows, and is fragile on Unix (orphaned shells, quoting, PATH).

Location

  • phantom-cli/src/commands/reveal.rs:58-59

Fix

Spawn a detached thread that calls std::thread::sleep(Duration::from_secs(30)) then writes an empty string using the cross-platform clipboard path from the clipboard issue. No shell required.

Depends on the clipboard issue — once arboard (or equivalent) is in place, this becomes a few lines of safe, platform-agnostic code.

Severity

Functional gap — auto-clear unavailable on Windows, fragile on Unix.

Tracker: #1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestwindowsWindows platform support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions