program_status - report what a program is doing to the terminal.
program_status [-a app] [-i id] [-k kind] [-p percent] [-t title] state [message ...]
program_status writes one Program Status Protocol report (OSC 7501) to standard output. Terminals that support the protocol use it to show whether work is running, waiting on the user, finished, or failed, for example in tab headers or session lists. Terminals without support ignore it.
The message words are joined with spaces into one human-readable line. Rush handles the protocol encoding, including base64 for text values. It rejects invalid reports with a diagnostic instead of writing something the terminal would discard.
Each report replaces the terminal's record for its id completely. A key missing from a report is missing from the record afterwards. To keep -a or -t on a record, repeat them in every report.
Like printf, program_status writes to standard output whether or not it is a terminal. Redirect it, for example program_status working >/dev/tty, when standard output is captured.
idleworking-p. The terminal drops it when the process exits or the next shell prompt starts.blocked-k and -p. Dropped like working.doneerrordone.clear-i, removes every record on the terminal. Accepts only -i.-a appcargo: 1 to 32 characters from A-Z a-z 0-9 _ . + -. Child records without an app inherit the nearest ancestor's.-i idbuild/test is a child of build. Each segment uses the same characters as app.-k kindblocked program waits for: permission, question, or auth.-p percentworking and blocked.-t titleMessages may be up to 2048 bytes. Messages and titles must be UTF-8 without control characters. Option values may also be attached, as in -p40. Use -- before a state when the arguments that follow might begin with -.
Zero when the report was written, one when writing failed, and two for usage errors and invalid reports.
program_status -a rsync working "Syncing photos" if rsync -a ~/Photos backup:/photos; then program_status -a rsync done "Photos synced" else program_status -a rsync error "rsync failed" fi program_status -a deploy -k permission blocked "Approve deploy to production?" program_status -i deploy/eu-west -t "EU West" -p 40 working "Pushing image" program_status -i deploy clear
rush-builtins(7), rush configuration: program status, Program Status Protocol.