Skip to content

provisioning: exclude Touch Bar DRM connectors in kmscon and fall back to plain VT if narrow - #22022

Open
maralcbr wants to merge 1 commit into
quattrofrom
fix/touchbar-kmscon-provision-owner
Open

maralcbr wants to merge 1 commit into
quattrofrom
fix/touchbar-kmscon-provision-owner

Conversation

@maralcbr

@maralcbr maralcbr commented Dec 6, 2026

Copy link
Copy Markdown
Member

Fixes the upstream omacom/omarchy side of omacom/omarchy-mac-pkgs#269 (paired with the Apple Silicon boot-package drop-in in omacom/omarchy-mac-pkgs#275; complements #21189).

Root Cause

kmscon v10.1.3 defaults to multi-monitor=scaled, which computes the minimum column and row count across all active displays (terminal_update_size_scaled -> terminal_update_size_clone). On Touch Bar Macs (adp exposing DSI-1 on Apple Silicon J293/J493, appletbdrm exposing USB-* on Intel T2), the ~60 px Touch Bar collapses the main panel grid to ~4 columns, causing gum filter in the timezone prompt to exit non-zero and loop Keyboard -> Timezone -> Keyboard indefinitely.

Changes

  • install/provisioning/kmscon.sh: add omarchy_kmscon_touchbar_args() scanning /sys/class/drm/card* for adp or appletbdrm drivers and passing --screen=[<connector>]disabled for each of their connectors (leaving internal/external monitors on scaled instead of globally switching to largest, which would blank laptop panels when paired with a 4K external monitor).
  • bin/omarchy-provision-owner:
    • Add a narrow-console fallback (< 40 columns) checked after wait_console_stable and again after greeter_screen (covering late resize events), dropping out of kmscon once onto plain VT1 via $KMSCON_STATE/plain-vt.
    • Skip record_finished_icon when $KMSCON_STATE/plain-vt is present.
    • Clear both $KMSCON_STATE/shell and $KMSCON_STATE/plain-vt on outer-wrapper entry so retrying omarchy-provision-owner from the recovery shell works.
    • Reapply the saved keymap via apply_keyboard when resuming from $KMSCON_RESUME on plain VT.
  • test/shell.d/provision-owner-keyboard-test.sh: cover adp/appletbdrm connector disabling (leaving eDP-1 enabled) and plain-VT finished-icon suppression.

Verification

  • All 49/49 tests in test/shell.d/provision-owner-keyboard-test.sh and 32/32 tests in test/shell.d/setup-form-test.sh pass on Linux aarch64 (m1-pro and Arch Linux ARM container with gum 2.0.2).
  • Two-round Codex read-only review (gpt-6.2-astra) completed and every finding addressed (including keeping gum filter strict mode so city search like London -> Europe/London does not regress).

…k to plain VT if narrow

On Touch Bar Macs (Apple Silicon `adp` -> `DSI-1`, Intel T2 `appletbdrm`
-> `USB-*`), kmscon v10.1.3 defaults to `multi-monitor=scaled`, which
computes the minimum column/row count across all screens and shrinks the
main display during first-boot owner setup to ~4 columns, causing `gum
filter` in the timezone prompt to exit non-zero and loop back to
keyboard setup (omacom/omarchy-mac-pkgs#269).

- Detect `adp` and `appletbdrm` DRM cards in `kmscon.sh` and pass
  `--screen=[<connector>]disabled` while leaving normal displays on
  `scaled`.
- Guard `omarchy-provision-owner` against any narrow kmscon grid
  (`< 40` columns) both after `wait_console_stable` and after
  `greeter_screen`, falling through once to plain VT1, skipping the
  kmscon finished-icon painter, clearing both `shell` and `plain-vt`
  markers on wrapper entry so recovery-shell retries work, and
  reapplying the saved keymap on plain-VT resume from `KMSCON_RESUME`.
- Add unit tests in `test/shell.d/provision-owner-keyboard-test.sh`.

Signed-off-by: Marcelo Alcantara <maralc@gmail.com>
Copilot AI balanced review requested due to automatic review settings December 6, 2026 05:18
@greptile-apps

greptile-apps Bot commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

This PR keeps Touch Bar displays out of kmscon and adds a plain-VT fallback for consoles narrower than 40 columns.

  • kmscon disables Touch Bar connectors without disabling the main display.
  • Owner setup switches to the plain VT when kmscon stays too narrow.

No actionable issues were found. Review was based on source inspection; no runtime or visual verification was performed.

Diagram

%%{init: {'theme': 'neutral', 'htmlLabels': false}}%%
flowchart TD
  A[Start owner setup] --> B[Start kmscon without Touch Bar connectors]
  B --> C{Console narrower than 40 columns?}
  C -->|No| D[Continue setup in kmscon]
  C -->|Yes| E[Write plain-vt marker and exit kmscon]
  E --> F[Release finished-icon painter]
  F --> G[Continue setup on plain VT]
  G --> H[Reapply saved keyboard if resuming]
  H --> I[Finish without recording kmscon icon]
Loading

Reviews (1) · Last reviewed commit: "provisioning: exclude Touch Bar DRM conn..." · Reviewed by Greptile

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.

🔵 Needs a closer look

The tests do not exercise the real narrow-console handoff, boundary and resize behavior, or saved-keymap resume outcomes, leaving regressions in these paths undetected.

No open issues 🎉

What changed in this PR

Prevents Touch Bar displays from shrinking Omarchy’s provisioning console and adds a plain-VT fallback when kmscon remains too narrow.

Changes:

  • Disable connectors belonging to Touch Bar DRM drivers.
  • Fall back to plain VT, restore the saved keymap, and suppress the kmscon completion icon.
  • Add connector-filtering and icon-suppression tests.
File Description
test/​shell.d/​provision-owner-keyboard-test.sh Tests Touch Bar connector exclusion and plain-VT icon suppression.
install/​provisioning/​kmscon.sh Detects Touch Bar drivers and disables their connectors.
bin/​omarchy-provision-owner Adds narrow-console fallback, retry cleanup, and keymap restoration.

Review effort: Balanced

@omarchybot omarchybot added bug Something isn't working compatibility Make Omarchy work better on everything! labels Dec 6, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Recommend: Hold — waiting for first-boot confirmation on an affected Touch Bar Mac.

@D-Pagey or a maintainer, please install a candidate image with Omarchy runtime commit c12c1b0528ce3275490ed7fb4e73f731bafb411a and the stock Mac boot package. Boot with the internal display and without the Touch Bar workaround, then confirm whether setup stays readable and advances past Timezone. Candidate image instructions

The CLI and focused provisioning tests passed on an ISO worker, and a simulated four-column console exercised the VT fallback. Codex High, Opus 5.5 High and muse-wonder via pi, thinking high confirmed that the fallback adds a second console-settle wait before the greeter (bin/omarchy-provision-owner:1650 and :543). Please reuse the greeter's existing wait on the fresh-start path if the generic fallback stays here. Its keymap and retry changes overlap #21189.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working compatibility Make Omarchy work better on everything!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants