Skip to content

Report failed screen recording starts instead of exiting 0 - #18803

Closed
ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/0e05ab0f-e73e-4fc5-8cf9-e43f9e0dc750
Closed

ThePrimeagen wants to merge 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/0e05ab0f-e73e-4fc5-8cf9-e43f9e0dc750

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

Starting a screen recording in bin/omarchy-capture-screenrecording reports success when the recorder crashes before writing a file: it exits 0 with no warning, even though --status shows nothing is recording.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Enter to open a terminal.
  2. When the recorder backend aborts before creating its file, for example with no usable microphone or GPU backend, run omarchy capture screenrecording --fullscreen --with-microphone-audio; echo START:$?.
  3. Run omarchy capture screenrecording --status; echo ST:$?.
  4. You see the recorder abort, START:0 and no failed-start warning, while ST:1 shows no recording is running.

More cases

Capture menu: With desktop + microphone audio

Before After
before after

Webcam wrapper

Before After
before after

Related

When every recorder backend died before creating its file,
start_screenrecording now sends a critical notification and
returns a distinct failure code, and its caller exits 1 after
cleanup. Picker cancellations still return silently with 0.
This also fixes the menu and webcam-wrapper paths, which rely
on the main script's notification and exit status.
@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; no actionable issues remain.

Summary

Failed recording starts now show a warning and exit with status 1.

  • Failed screen recordings now show a notice and exit with status 1.

Reviews (3) · Last reviewed commit: "Stay silent on a late cancel, and say ho..." · Reviewed by Greptile

Comment thread bin/omarchy-capture-screenrecording Resolved
The failed-start case discarded the exit status, so it passed whether a
start that found no working recorder exited 0 or 1. It now checks for
exit status 1 and the failed-start notification.

Co-authored-by: Cursor <cursoragent@cursor.com>
A cancel that lands while the last recorder is being stopped after its ready timeout reached the failure notification, so cancelling could report a failed start and exit 1. The notification now also points at OMARCHY_SCREENRECORD_DEBUG, since the recorder's stderr goes to /dev/null without it. Both come from omacom#7189.

Co-Authored-By: Literato2 <317679755+Literato2@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed 994e570 on top of this branch, so this is ready for the maintainer.

What changed.

  • start_cancelled && return 1 now runs just before the failure notification. A cancel that lands while the last recorder is being stopped after its ready timeout, or during the cleanup after it, used to reach the critical "failed to start" notification and exit 1. Now it stays silent and exits 0, like any other cancel.
  • The notification now has a body, through a new catalog key capture.recordingFailedDebug: "Set OMARCHY_SCREENRECORD_DEBUG=true and retry to log why." Without that variable, the recorder's stderr goes to /dev/null.

Both come from @Literato2's earlier #7189 for the same bug, so they are credited as co-author on the commit.

What was proved, on a worker built from the Omarchy ISO.

  • test/shell.d/screenrecording-test.sh: 39 passed.
  • test/shell.d/i18n-test.sh: 401 passed.
  • A late-cancel harness: the only recorder never creates its file, and its TERM handler touches the cancel file, so the cancel lands during the timeout teardown. At this PR's previous head (03f1b44) the script exited 1 with the critical notification. At 994e570 it exited 0 with no notification.

Tests. The test this PR adds stays as it is. It extends the existing "a recorder that cannot start" case by a few lines, runs the real script with a recorder that fails, and checks the exit status and the notification, so it fails on the base and catches a regression of this fix. No test was added for the late-cancel guard. Reaching that window needs a stub that turns a TERM into a cancel plus a 15-second timeout, which is far bigger than a one-line guard, so the harness run above is the evidence instead.

Second opinion. Codex Medium reviewed the new commit and found no defects. It confirmed that the guard covers both late-cancel paths, that the catalog key is well-formed, and that the PR's test is proportionate. Its agreement is not guaranteed to be independent.

@dhh

dhh commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

This isn't helpful enough. If the notification actually gave you some clear direction on what was happening, okay, maybe. But otherwise no. Even better would just be to fix whatever is preventing this from succeeding. This feels like paving over bugs.

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.

3 participants