Keep offering the deferred install after backing out

The keyboard screen only advertised Ctrl+C on its first showing. Backing out
of the user step — Esc from the account form, or "No, change it" on the review
table — returned to the same screen with the hint gone and Ctrl+C back to
aborting the install, so an operator who started a direct install could no
longer switch to preparing the machine for another owner.

Offer it on every visit instead. Nothing has touched the disk at that point in
either path, and the confirmation screen still catches a stray Ctrl+C. The user
step now returns as soon as the keyboard screen arms deferral, and the main
flow re-checks the flag before choosing a branch, so a late deferral clears the
half-entered credentials and goes straight to disk selection.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5 committed 2026-08-13 11:14:44 -07:00
1 parent d6cd2d30a6
commit 730ae083c4
1 file changed
+24 -14
+24 -14
View File
@@ -194,19 +194,19 @@ notice() {
keyboard_form() { keyboard_form() {
# The Ctrl+C hint sits directly under the header (no blank line between), # The Ctrl+C hint sits directly under the header (no blank line between),
# matching the disk-overwrite screen's unencrypted offer. Ctrl+C on the first # matching the disk-overwrite screen's unencrypted offer. Ctrl+C here is the
# screen is the hidden entry into deferred provisioning; $1 is "true" only for that first # hidden entry into deferred provisioning, and the offer stands on every visit
# invocation, so the review-loop re-edit can't flip a user install into it. # to this screen: the user step unwinds back here on Esc and on "No, change
local allow_defer_provisioning="${1:-false}" # it", and nothing is on disk yet either way, so backing up out of a user
# install must not strand the operator without the deferred option. Callers
# re-check defer_provisioning after this returns.
local status local status
while true; do while true; do
clear_logo clear_logo
echo echo
say "Let's setup your machine..." say "Let's setup your machine..."
if $allow_defer_provisioning; then say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
fi
echo echo
omarchy_prompt_keyboard && status=0 || status=$? omarchy_prompt_keyboard && status=0 || status=$?
@@ -215,7 +215,7 @@ keyboard_form() {
# Esc means "back", and nothing precedes the first screen, so re-ask. # Esc means "back", and nothing precedes the first screen, so re-ask.
((status == OMARCHY_FORM_BACK)) && continue ((status == OMARCHY_FORM_BACK)) && continue
if $allow_defer_provisioning && ((status == OMARCHY_FORM_SIGNAL)); then if ((status == OMARCHY_FORM_SIGNAL)); then
if confirm_prepare_for_another_owner; then if confirm_prepare_for_another_owner; then
defer_provisioning=true defer_provisioning=true
return 0 return 0
@@ -266,6 +266,9 @@ user_form() {
omarchy_prompt_timezone || return $? omarchy_prompt_timezone || return $?
} }
# Returns 0 once the account details are confirmed, or as soon as the keyboard
# screen this unwinds to arms deferred provisioning — the caller checks
# defer_provisioning to tell the two apart.
user_step() { user_step() {
local status local status
@@ -277,6 +280,7 @@ user_step() {
# keeps its long-standing behaviour of ending the install. # keeps its long-standing behaviour of ending the install.
((status == OMARCHY_FORM_BACK)) || abort ((status == OMARCHY_FORM_BACK)) || abort
keyboard_form keyboard_form
$defer_provisioning && return 0
continue continue
fi fi
@@ -296,6 +300,7 @@ Keyboard,$keyboard" |
break break
else else
keyboard_form keyboard_form
$defer_provisioning && return 0
fi fi
done done
} }
@@ -938,7 +943,7 @@ confirm_disk_overwrite() {
# Decide what and how to install: sets install_target (full_disk|free_space), # Decide what and how to install: sets install_target (full_disk|free_space),
# install_target and encrypt_installation. Nothing is written to disk yet — # install_target and encrypt_installation. Nothing is written to disk yet —
# the user step runs between this and the execution below. (deferred provisioning never # the user step runs between this and the execution below. (deferred provisioning never
# reaches here; it's armed by Ctrl+C on the first screen and goes straight to # reaches here; it's armed by Ctrl+C on the keyboard screen and goes straight to
# disk selection.) # disk selection.)
select_installation() { select_installation() {
local full_disk_only local full_disk_only
@@ -992,7 +997,16 @@ wait_for_stable_terminal
greeter greeter
keyboard_form true keyboard_form
# Normal install: keyboard (done above) → user → disk → install mode. The
# keyboard chosen above is already loaded, so the LUKS passphrase entered in
# the user step is typed under the right layout. The user step can unwind back
# to the keyboard screen (Esc, or "No, change it"), and Ctrl+C there arms
# deferred provisioning, so it returns early and this re-checks the flag.
if ! $defer_provisioning; then
user_step
fi
if $defer_provisioning; then if $defer_provisioning; then
# Deferred provisioning: no user setup, and the keyboard is deferred to the machine's first # Deferred provisioning: no user setup, and the keyboard is deferred to the machine's first
@@ -1018,10 +1032,6 @@ if $defer_provisioning; then
done done
install_target="full_disk" install_target="full_disk"
else else
# Normal install: keyboard (done above) → user → disk → install mode. The
# keyboard chosen above is already loaded, so the LUKS passphrase entered in
# the user step is typed under the right layout.
user_step
disk_form disk_form
select_installation select_installation
fi fi