Skip to content

Wait for ttfx before closing its terminal - #6773

Merged
dhh merged 1 commit into
omacom:quattrofrom
grantwiley:agent/wait-for-ttfx-before-closing-terminal
Aug 13, 2026
Merged

dhh merged 1 commit into
omacom:quattrofrom
grantwiley:agent/wait-for-ttfx-before-closing-terminal

Conversation

@grantwiley

Copy link
Copy Markdown
Contributor

Fixes #6762.

This follows up on #6764. That change sends SIGTERM to ttfx before closing the screensaver terminal, but pkill returns as soon as the signal is sent. It does not wait for the process to exit.

ttfx handles SIGTERM asynchronously so it can finish its current loop and clean up the terminal. During that short window, the next command can still close the PTY. A final frame write then fails with EIO; trying to report that error to the same closed terminal panics and produces the SIGABRT core dump.

This change keeps the terminal alive until ttfx has exited by adding a bounded pidwait between the two kills. The one-second timeout keeps locking responsive if ttfx ever refuses to stop; normal shutdown should take only a few milliseconds.

The regression test now checks for all three operations in order: signal ttfx, wait for it to exit, then close the screensaver terminal.

Checks

  • bash test/shell.d/system-lock-test.sh
  • bash -n bin/omarchy-system-lock test/shell.d/system-lock-test.sh
  • Live delayed-process check confirming pidwait blocks until the matching process exits

@grantwiley
grantwiley marked this pull request as ready for review August 12, 2026 21:54
Copilot AI balanced review requested due to automatic review settings August 12, 2026 21:54

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

Attempts to prevent ttfx core dumps by waiting before closing its terminal.

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.

Changes:

  • Adds a bounded pidwait after signaling ttfx.
  • Updates the regression test to verify shutdown command order.

Reviewed changes

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

File Description
bin/omarchy-system-lock Waits for ttfx before closing the screensaver terminal.
test/shell.d/system-lock-test.sh Verifies signal, wait, and terminal-close ordering.

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

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