Skip to content

Do not save a screen recorder that died after creating its file - #18814

Closed
ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/c7168710-b9b1-402c-a563-1aae1deb0285
Closed

ThePrimeagen wants to merge 2 commits into
omacom:quattrofrom
ThePrimeagen:fix/c7168710-b9b1-402c-a563-1aae1deb0285

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Starting a screen recording can report success even though the recorder died right after creating its file. bin/omarchy-capture-screenrecording then leaves a tiny unplayable screenrecording-*.mp4 in ~/Videos, saves the dead pid, and shows no error.

Screenshots

Before After
before after

Reproduce

  1. Open a terminal with Super+Return.
  2. Run omarchy capture screenrecording; echo AFTER:$?.
  3. In the region picker, drag a region or press Return to take the window.
  4. If the recorder aborts after creating its file, you see the abort message but AFTER:0, with no error notification and an unplayable 48-byte file left in ~/Videos.

More cases

Fullscreen start with desktop audio

Before After
before after

Running omarchy capture screenrecording --fullscreen --with-desktop-audio; echo START:$? also reported START:0 for a recorder that died after creating its file, instead of START:1 with no dead pid saved.

Related

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.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous missing-test finding addressed.

Summary

The PR stops saving recorders that die just after creating their output file.

  • Screen recordings start only when the recorder stays alive.

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

Comment thread bin/omarchy-capture-screenrecording Resolved
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>
@omarchybot

Copy link
Copy Markdown
Collaborator

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.

@omarchybot omarchybot closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants