From 76b9331d8b4c3c4ac5453c80f4c403aa04dd180e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Fri, 9 Oct 2026 00:52:26 -0400 Subject: [PATCH] Escape commas in the keyboard preselect; gum splits --selected on them --- install/provisioning/setup-form.sh | 2 +- test/shell.d/setup-form-test.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install/provisioning/setup-form.sh b/install/provisioning/setup-form.sh index 84bf535c..862f6b10 100644 --- a/install/provisioning/setup-form.sh +++ b/install/provisioning/setup-form.sh @@ -151,7 +151,7 @@ omarchy_prompt_language() { omarchy_prompt_keyboard() { local choice status selected=${1:-English (US)} choice=$(printf '%s\n' "$OMARCHY_KEYBOARD_LAYOUTS" | cut -d'|' -f1 | - gum choose --height 10 --selected "$selected" --header "$(omarchy_text "Select keyboard layout")") && status=0 || status=$? + gum choose --height 10 --selected "${selected//,/\\,}" --header "$(omarchy_text "Select keyboard layout")") && status=0 || status=$? ((status == 0)) || return $status local selection diff --git a/test/shell.d/setup-form-test.sh b/test/shell.d/setup-form-test.sh index ea7aa04a..a7923465 100755 --- a/test/shell.d/setup-form-test.sh +++ b/test/shell.d/setup-form-test.sh @@ -170,8 +170,8 @@ grep -qF -- '--selected English (US)' "$GUM_ARGS" || fail "keyboard prompt prese pass "keyboard prompt maps the chosen label to its keymap" PROMPT_ARG="Chinese (Simplified, Pinyin)" run_prompt omarchy_prompt_keyboard "0:Chinese (Simplified, Pinyin)" -grep -qF -- '--selected Chinese (Simplified, Pinyin)' "$GUM_ARGS" && [[ $(field keyboard_input_method) == "pinyin" ]] || - fail "keyboard prompt preselects the layout its caller names" +grep -qF -- '--selected Chinese (Simplified\, Pinyin)' "$GUM_ARGS" && [[ $(field keyboard_input_method) == "pinyin" ]] || + fail "keyboard prompt preselects the layout its caller names, escaping the comma gum splits --selected on" pass "keyboard prompt preselects the layout its caller names" for selection in 'Japanese|jp106|mozc|' 'Japanese (US keyboard)|us|mozc|' 'Korean|us|hangul|kr' 'Chinese (Simplified, Pinyin)|us|pinyin|' 'Chinese (Traditional, Zhuyin)|us|chewing|'; do