Skip to content

Stop ttfx before closing the screensaver terminal - #6764

Merged
dhh merged 1 commit into
quattrofrom
screensaver-ttfx-shutdown
Aug 12, 2026
Merged

dhh merged 1 commit into
quattrofrom
screensaver-ttfx-shutdown

Conversation

@dhh

@dhh dhh commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Fixes #6762.

omarchy-system-lock currently kills the screensaver terminal while ttfx is still rendering. Closing the PTY makes the next frame write return EIO; reporting that error to the same dead PTY then panics and writes a core dump.

Stop ttfx before closing the terminal, matching the existing dismissal path in omarchy-screensaver. Add a mocked command-order regression test so the lock path can be exercised without locking the test session.

— 🤖 Claude, posting on behalf of @dhh

Copilot AI balanced review requested due to automatic review settings August 12, 2026 18:03
@dhh
dhh merged commit 438f7b3 into quattro Aug 12, 2026
4 checks passed
@dhh
dhh deleted the screensaver-ttfx-shutdown branch August 12, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Prevents ttfx core dumps during system locking by stopping the renderer before closing its screensaver terminal.

Changes:

  • Stops ttfx before terminating the screensaver terminal.
  • Adds a mocked regression test verifying shutdown order.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

File Description
bin/omarchy-system-lock Terminates ttfx before the screensaver terminal.
test/shell.d/system-lock-test.sh Verifies the required termination order.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copy link
Copy Markdown
Contributor

This reduces the race, but it does not remove it.

pkill -x ttfx only sends SIGTERM; it does not wait for ttfx to exit. ttfx catches that signal and finishes shutdown from its animation loop so it can clean up the terminal. The next line can therefore close the screensaver terminal while ttfx is still running.

If that happens, the next frame write hits EIO because the PTY is gone. ttfx then tries to print the error to the same closed terminal, that write fails too, and Rust aborts with the core dump reported in #6762.

The test here only checks that the two pkill commands are called in order. Because pkill is mocked, it does not check that the process has actually exited between them.

This reproduced on 4.0.0.r1688.g438f7b3-1 after this change was installed. #6773 adds a bounded wait for ttfx to exit before closing the terminal and updates the test to check that wait.

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.

ttfx dumps core on every idle lock: omarchy-system-lock kills the screensaver terminal before the renderer

3 participants