Skip to content

Keep the hibernation prompt memory size locale-safe - #14520

Merged
dhh merged 1 commit into
omacom:quattrofrom
manuaudio:fix/hibernation-prompt-locale
Oct 15, 2026
Merged

dhh merged 1 commit into
omacom:quattrofrom
manuaudio:fix/hibernation-prompt-locale

Conversation

@manuaudio

Copy link
Copy Markdown
Contributor

Fixes #14507.

omarchy hibernation setup reads the total memory from free --human for its confirmation prompt. free localizes its row labels, but the parser only matches Mem. On a non-English locale such as zh_CN.UTF-8, the match is empty and the user sees Use on boot drive to make hibernation available?.

I scoped LC_ALL=C to this one free call. That keeps the existing parser and output format while leaving the user's locale unchanged for the rest of the command. Swap sizing is unaffected because it already reads /proc/meminfo; this only repairs the interactive size shown before setup.

The focused regression runs the real setup command with a free fixture that emits a localized label unless it receives LC_ALL=C, then stops safely at the confirmation prompt. Before the implementation it failed because the prompt had no size. It now passes with Use 31Gi on boot drive to make hibernation available?.

Checked with:

  • test/shell.d/hibernation-setup-test.sh
  • bash -n bin/omarchy-hibernation-setup test/shell.d/hibernation-setup-test.sh
  • shellcheck -S warning bin/omarchy-hibernation-setup test/shell.d/hibernation-setup-test.sh
  • git diff --check

I did not create a real swapfile or rebuild a UKI; the changed path ends at the confirmation prompt.

@greptile-apps

greptile-apps Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low risk] Fixes locale handling in a hibernation setup script.

The PR appears safe to merge; no blocking issue remains.

What we checked:

  • Test cannot create a swapfile: The fixtures bypass the earlier setup branch. The gum fixture declines the prompt, so the command exits before changing swap or boot settings.

Summary

Makes the hibernation prompt show the memory size regardless of the user's locale.

  • Applies LC_ALL=C only to the free call.
  • Adds a focused test that stops at the confirmation prompt.
  • Clears inherited LC_ALL so the test catches the original regression.

Reviews (2) · Last reviewed commit: "[verified] Keep hibernation prompt memor..." · Reviewed by Greptile

Comment thread test/shell.d/hibernation-setup-test.sh Resolved
@manuaudio
manuaudio force-pushed the fix/hibernation-prompt-locale branch from 8146783 to 99d980a Compare October 8, 2026 03:46
@manuaudio

Copy link
Copy Markdown
Contributor Author

Greptile was right that an ambient LC_ALL=C could let the fixture pass without the production override. Commit 99d980a2 now runs the command through env -u LC_ALL, so the fixture starts from a guaranteed non-overridden state. With the production line reverted, the focused test fails even when the test runner itself has LC_ALL=C; at the new head, LC_ALL=C test/shell.d/hibernation-setup-test.sh passes.

@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed at 99d980a and verified on a fresh Omarchy worker. Nothing found to change.

Reproduction. On the worker, free --human under zh_CN.UTF-8 and ko_KR.UTF-8 prints a translated row label, so awk '/Mem/ {print $2}' returns nothing and the hibernation prompt asks to use an empty size; ja_JP and zh_TW keep Mem: and are unaffected. Since Setup > Language can now set a Chinese or Korean LANG, that path is reachable from the menu. The new hibernation-setup-test.sh fails on quattro and passes with the fix, so it is not vacuous.

Suite. The full shell suite ran on the worker with this change applied: 6458 passed, 2 failed. The failures are in background-instant-reload-test.sh, background-intro-clone-test.sh and hyprland-startup-cursor-cold-test.sh, which fail the same way on unpatched quattro.

Second opinion. Codex at medium effort found no defects: LC_ALL=C reaches only free, the test runs the real script and asserts the full prompt, and the script's other parses read kernel or numeric output that does not translate. It agreed with the conclusion above, and its independence is not guaranteed.

This is waiting on the maintainer.

@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review labels Oct 14, 2026
@dhh
dhh merged commit aec2190 into omacom:quattro Oct 15, 2026
1 check passed
omarchybot added a commit to yashranaway/omarchy that referenced this pull request Oct 15, 2026
quattro added its own test/shell.d/hibernation-setup-test.sh for the locale-safe memory prompt (omacom#14520). Both tests are kept in one file: the locale check runs last with its own stubs, and uses the image_size override so it no longer skips where /sys/power/image_size is absent.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
omarchybot added a commit to AnPod/omarchy that referenced this pull request Oct 15, 2026
quattro added its own test/shell.d/hibernation-setup-test.sh (the locale-safe memory prompt check, omacom#14520), which collided with this branch's new test of the same name. Keep quattro's file as it is and move this branch's fixture test to hibernation-resume-setup-test.sh: the two test different things, and quattro's skips the whole file on a host without /sys/power/image_size, which would have skipped the fixture tests too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hibernation prompt loses RAM size on non-English locales (hibernation-setup parses localized free output)

4 participants