Skip to content

Keep the terminal screensaver from scrolling (4.5) - #18282

Closed
cornedor wants to merge 1 commit into
omacom:v4-5-1from
cornedor:fix/screensaver-no-scrollback-v451
Closed

cornedor wants to merge 1 commit into
omacom:v4-5-1from
cornedor:fix/screensaver-no-scrollback-v451

Conversation

@cornedor

@cornedor cornedor commented Nov 9, 2026 •

Copy link
Copy Markdown

Closes #18230

What changes

omarchy-screensaver draws on the terminal's primary screen, and ttfx never switches to the alternate one. In Ghostty, Shift+PageUp, the mouse wheel or the touchpad scroll the animation up into the scrollback and show a scrollbar, and the screensaver stays up.

  • Enter the alternate screen (\033[?1049h) before anything is drawn. It has no scrollback, so there is nothing to scroll. It's done in the script, so the fix covers every supported terminal rather than only Ghostty's config.
  • Turn off alternate scroll mode (\033[?1007l), so a wheel scroll is not sent to the script as arrow keys. Scrolling does nothing instead.
  • exit_screensaver restores both after pkill -x ttfx. In the screensaver window this is never visible, because the same function closes the window right after. It matters when the script is run by hand in another terminal. There, pkill doesn't wait for ttfx to exit, so a frame it is still drawing can land on the normal screen. That is cosmetic, so exit_screensaver doesn't wait for ttfx the way omarchy-system-lock does since Wait for ttfx before closing its terminal #6773: the abort that wait prevented no longer happens (see Verification).

quattro replaced the terminal screensaver with a native one, so this only applies to the 4.5 branch.

Verification

Ghostty 1.4.0, stock default/ghostty/screensaver config and stock banner, launched with the screensaver class on its own special workspace:

  • Shift+PageUp three times: before, the animation scrolled into scrollback and a scrollbar appeared at the right edge; after, nothing scrolled, no scrollbar, the screensaver stayed up.
  • Run by hand in an ordinary Ghostty window after printing a few lines (it exits after about a second there, since that window doesn't have the screensaver class): before, those lines were drawn over and a frame of the animation was left behind; after, the lines are intact and the prompt continues under them.

foot 1.28.0, the default terminal, with stock default/foot/screensaver.ini, launched the same way:

  • Mouse wheel and touchpad, by hand: before, the screensaver scrolled; after, nothing scrolls and the screensaver stays up.
  • Shift+PageUp now closes the screensaver in foot. On the alternate screen foot passes the key to the script instead of scrolling, so it counts as a key press like any other.

Closing the terminal right after pkill -x ttfx, as exit_screensaver does, used to make ttfx abort with a core dump (#6762). With ttfx 0.5.0-3 in foot, running omarchy-system-lock with its pidwait removed while the screensaver was up, at a random point in the effect: 10 runs, no ttfx core dumps (coredumpctl list /usr/bin/ttfx). The current lock: 20 runs, none either.

Not checked: real mouse wheel or touchpad input and the ttfx abort check in Ghostty, and Alacritty and kitty at all.

No test added: three lines of escape sequences, and no existing test covers this script.

Draw it on the alternate screen, which has no scrollback, and turn off
alternate scroll so the wheel isn't sent as arrow keys. Restore both on
exit, after ttfx is stopped so no frame lands on the normal screen.
@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The change is limited to the terminal screensaver workflow.

The PR appears safe to merge, with a non-blocking shutdown race when the screensaver runs in an ordinary terminal.

Findings

  1. P2 Animation overwrites restored text ▶

Summary

Moves the terminal screensaver onto the alternate screen and disables wheel-to-arrow input while it runs.

  • The screensaver stays on its own screen and restores the terminal when it exits.

Reviews (1) · Last reviewed commit: "Keep the terminal screensaver from scrol..." · Reviewed by Greptile

Comment thread bin/omarchy-screensaver Resolved
@ryanrhughes

Copy link
Copy Markdown
Collaborator

Thanks for tracking this down! 4.5.1 now ships 4.6's native Wayland screensaver (#19068) in place of the terminal one. It draws its own overlay, so there's no scrollback to scroll into, and any scroll closes it. Closing as superseded.

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