You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-s/--sleep is no longer skipped when there is nothing to force-quit. Every
mode that found zero victims exited before reaching the sleep code, so fq -o -y -s — the natural "quit everything else, then sleep" command —
silently did nothing at all when every other application was protected or
the application running the terminal was the only one left. The sleep is now
a step of its own that every mode reaches; with nothing to quit and without -y, fq asks about the sleep alone ("Put the Mac to sleep? [y/N]") instead
of asking to force-quit zero applications.
The sleep is no longer asked for twice: the combined "force quit … and put
the Mac to sleep?" confirmation now covers the sleep, so a single y both
quits and sleeps. This was still broken when naming an application on the
command line (fq -s Safari), which asked a second time after the first y
and then treated the second, unanswered prompt as a decline — so the Mac was
never put to sleep.
Added
FQ_SLEEP_CMD overrides the program used to put the Mac to sleep, and FQ_APPS_FILE (pid name lines) overrides application enumeration. Both
exist so the test suite can exercise the real code paths without touching
running applications or actually sleeping the machine.
Tests
test/test_sleep.sh covers the sleep behaviour end to end, driven through
the built executable with a synthetic application list and a stub sleep
command: nothing-to-quit still sleeps (including a machine with no
applications at all), one confirmation never asks twice (for --others, --pid, and a named application alike), a declined confirmation never
sleeps, and a refused protected application exits 1 without sleeping.