Skip to content
whispr-devPublic

About

ever get annoyed by closing a terminal that was running for 6hrs and near done? not no more!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

stayput

Run long jobs so an accidental click on the X can't kill them.

Your terminal becomes a window onto the job instead of the job's house: stayput run starts the command in its own hidden console and logs its output; your terminal just shows that log live. Close the window → you lose the view, not the job. stayput attach brings the view back.

Install (Windows 11)

Needs Rust (https://rustup.rs, with the MSVC build tools it offers to install).

cd stayput
cargo test
cargo install --path .

That puts stayput.exe in %USERPROFILE%\.cargo\bin (already on PATH after rustup). Open a NEW terminal so PATH is refreshed.

Use

stayput run cargo build --release          # watch it live; closing the window is now harmless
stayput run -n render python render.py     # give it a name
stayput run -d -n backup robocopy D:\src E:\dst /MIR   # start in background, don't watch
stayput run pwsh -NoProfile -c "Get-ChildItem C:\ -Recurse | Measure-Object"

stayput list          # what's running / finished, with exit codes
stayput attach        # re-watch (name optional if only one job is running)
stayput attach render --all   # replay the whole log, then follow
stayput kill render   # stop a job and everything it started
stayput rm render     # delete a finished job's log
stayput clean         # delete all finished jobs

-- before the program is optional (PowerShell sometimes eats it anyway). PowerShell commands (cmdlets, pipes) need wrapping: stayput run pwsh -c "...". cmd built-ins need stayput run cmd /c ....

Logs: %LOCALAPPDATA%\stayput\jobs\<name>\out.log (override with STAYPUT_HOME).

pin (classic console windows only)

In an old-style console window (conhost, e.g. Win+R → conhost.exe pwsh), stayput pin removes the X button; stayput unpin restores it. Alt+F4 still works. Windows Terminal draws its own X, which nothing outside WT can disable, so pin refuses there and tells you to use run.

Limits

  • Jobs are non-interactive: stdin is empty. Anything that asks a question will get EOF.
  • Some tools switch off progress bars / colours when output isn't a real terminal. Python is forced to stream (PYTHONUNBUFFERED=1); other tools may print in bursts.
  • Survives window closes, not reboots, sleep-induced kills, or logging off.
  • Output is written to disk: don't run things that print secrets unless you stayput rm after.

Also works on Linux (Lubuntu/DragonOS) as a nohup-with-reattach, minus pin.

About

ever get annoyed by closing a terminal that was running for 6hrs and near done? not no more!

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages