Repository navigation
Do not save a screen recorder that died after creating its file - #18814
ThePrimeagen wants to merge 2 commits into
Conversation
kill -0 succeeds on a zombie, so a recorder that created its output file and then aborted was saved as a live recording, the script returned success, and the unplayable file was left behind. Check the recorder's state in /proc in addition to kill -0, so a zombie is not running: the ready loop stops, the dead pid is not saved, and the partial file is removed, falling through to the next backend. Also propagate a failed start as exit 1 instead of letting the cleanup in the outer command return 0. The ISO build failure was unrelated to this change: it failed in pacman while installing packages to the new root with an invalid or corrupted package checksum, after this script had only changed a bash file and added no package or dependency.
[Medium impact] The PR appears safe to merge, with the previous missing-test finding addressed. SummaryThe PR stops saving recorders that die just after creating their output file.
No new actionable issues were found in the changes since the previous review. Tests were inspected but not run. Reviews (2) · Last reviewed commit: "Test a screen recorder that dies after c..." · Reviewed by Greptile |
A recorder that creates its file and exits a moment later now has a case of its own: the start exits 1, saves no pid or filename, and leaves no recording. The process helper gains a case for a recorder that exited but was not yet reaped, which it no longer counts. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Closing: the zombie check guards nothing, since bash already reaps its background children and the process helper already rejects zombies, and the new exit 1 turns cancelling the picker into a failure. If a settle delay after every recorder start turns out to be worth it, that is a small change on its own. Reviewed by Claude Opus 5.5 with Codex Medium as a second opinion; its independence is not guaranteed. |
Starting a screen recording can report success even though the recorder died right after creating its file.
bin/omarchy-capture-screenrecordingthen leaves a tiny unplayablescreenrecording-*.mp4in~/Videos, saves the dead pid, and shows no error.Screenshots
Reproduce
omarchy capture screenrecording; echo AFTER:$?.AFTER:0, with no error notification and an unplayable 48-byte file left in~/Videos.More cases
Fullscreen start with desktop audio
Running
omarchy capture screenrecording --fullscreen --with-desktop-audio; echo START:$?also reportedSTART:0for a recorder that died after creating its file, instead ofSTART:1with no dead pid saved.Related