Keep offering the deferred install after backing out (#107)

* 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>

* Trim the comments around the deferral check

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
David Heinemeier HanssonandClaude Opus 5 authored and GitHub committed 2026-08-13 20:55:07 +02:00
1 parent d6cd2d30a6
commit 7c50d72f40
1 file changed
+18 -15
+18 -15
View File
@@ -193,20 +193,16 @@ notice() {
# STEP 1: KEYBOARD LAYOUT
keyboard_form() {
# 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
# screen is the hidden entry into deferred provisioning; $1 is "true" only for that first
# invocation, so the review-loop re-edit can't flip a user install into it.
local allow_defer_provisioning="${1:-false}"
# Ctrl+C is the hidden entry into deferred provisioning, offered on every
# visit: the user step unwinds back here and nothing is on disk yet. Callers
# re-check defer_provisioning after this returns.
local status
while true; do
clear_logo
echo
say "Let's setup your machine..."
if $allow_defer_provisioning; then
say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
fi
say --foreground 8 "Press Ctrl+C to prepare this machine for another owner."
echo
omarchy_prompt_keyboard && status=0 || status=$?
@@ -215,7 +211,7 @@ keyboard_form() {
# Esc means "back", and nothing precedes the first screen, so re-ask.
((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
defer_provisioning=true
return 0
@@ -266,6 +262,8 @@ user_form() {
omarchy_prompt_timezone || return $?
}
# Returns 0 on confirmed account details, or as soon as the keyboard screen
# arms deferred provisioning.
user_step() {
local status
@@ -277,6 +275,7 @@ user_step() {
# keeps its long-standing behaviour of ending the install.
((status == OMARCHY_FORM_BACK)) || abort
keyboard_form
$defer_provisioning && return 0
continue
fi
@@ -296,6 +295,7 @@ Keyboard,$keyboard" |
break
else
keyboard_form
$defer_provisioning && return 0
fi
done
}
@@ -938,7 +938,7 @@ confirm_disk_overwrite() {
# Decide what and how to install: sets install_target (full_disk|free_space),
# install_target and encrypt_installation. Nothing is written to disk yet —
# 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.)
select_installation() {
local full_disk_only
@@ -992,7 +992,14 @@ wait_for_stable_terminal
greeter
keyboard_form true
keyboard_form
# Normal install: keyboard (loaded above, so the LUKS passphrase is typed under
# the right layout) → user → disk → install mode. The user step can unwind to
# the keyboard screen and arm deferral there, hence the second check.
if ! $defer_provisioning; then
user_step
fi
if $defer_provisioning; then
# Deferred provisioning: no user setup, and the keyboard is deferred to the machine's first
@@ -1018,10 +1025,6 @@ if $defer_provisioning; then
done
install_target="full_disk"
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
select_installation
fi