Repository navigation
capture: reach the recorder with --stop-recording even when the recordings directory is missing - #18895
capture: reach the recorder with --stop-recording even when the recordings directory is missing#18895AnPod wants to merge 2 commits into
Conversation
…dings directory is missing The recordings-directory gate fired for every run except --status, so a stop request exited before signaling an active recorder when OMARCHY_SCREENRECORD_DIR (or the Videos directory) had been renamed or unmounted. The stop reads its path back from the runtime state file and never writes into the directory, so --stop-recording now passes the gate like --status does; starting a recording still refuses with the same notification. Fixes omacom#18874
[Medium impact] The PR appears safe to merge; no new actionable issues were found. SummaryAllows
Reviews (3) · Last reviewed commit: "test: harden screenrecording stop state ..." · Reviewed by Greptile |
|
#17318 fixes the same thing and is older. It moves the directory check to the start path, so pressing the recording shortcut again also stops a recording whose folder is gone, not only |
|
Compared both diffs with the recording command, its menu/bar callers, and the tests. #17318 moves the directory check to the start path, so it also covers stopping via the no-argument or Your saved-PID stop and runtime-state cleanup checks add coverage beyond #17318's legacy-recorder test. I queued that coverage and its recorder-stub update for #17318's session to incorporate, keeping its toggle test. The start-refusal assertion will need to allow read-only recorder probes when carried over. Reviewed by GPT-6 High in Codex, with Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers agreed on the comparison; their independence is not guaranteed. They also identified the start-test adaptation above. No worker tests were run on this alternative after the comparison. This PR is waiting on the maintainer's choice between the fixes. |
Problem
omarchy capture screenrecording --stop-recordingexits before contacting the recorder whenever the configured recordings directory (OMARCHY_SCREENRECORD_DIR, or the Videos directory) is missing — renamed, unmounted, or on a drive that detached. The gate at the top of the script exempted only--status, so a recording that was started before the directory disappeared could not be stopped at all: every stop request answered with the "no recordings directory" notification and exit 1, and the recorder kept running.Fix
The recordings directory only names new recordings. A stop reads its path back from the runtime state file (
omarchy-screenrecord-filename) and never writes into the directory, so--stop-recordingnow passes the gate the same way--statusalready does:Starting a recording still refuses a missing directory with the same notification, so a start cannot fill a directory the user moved away.
Test
Extends
test/shell.d/screenrecording-test.sh(after the existing stop-path blocks) using its stub recorder helper:--stop-recordingwith a missing recordings directory and an active recording exits 0, sends--signal INT, ends the recording, notifies nothing about the directory, and clears its runtime state files.--fullscreen(a start) with the same missing directory still exits 1 with the notification and never reaches a recorder.Red-before (fix stashed) fails on exactly "stop reaches the recorder without a recordings directory"; green with the fix.
Note on the conflict surface:
bin/omarchy-capture-screenrecordingalso has other open PRs (#18885, #18817, #18814, #18803). This change touches only the directory gate, disjoint from the arg-parsing and start/stop-path hunks in those PRs, and the test block is placed away from the regions they add.Fixes #18874