From 3bc351ec0331fc42f63be786a2cac456c1a26c59 Mon Sep 17 00:00:00 2001 From: KeiSei84 <2206745@gmail.com> Date: Wed, 27 May 2026 15:08:09 +0800 Subject: [PATCH] =?UTF-8?q?fix(bootstrap):=20v0.48=20=E2=80=94=20reattach?= =?UTF-8?q?=20stdin=20to=20/dev/tty=20so=20curl|bash=20prompts=20fire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit INCIDENT: user installed via curl|bash and reported "kei did not auto-launch". Root cause: under curl|bash, stdin is the pipe from curl. Every interactive gate `[ -t 0 ]` returned FALSE, silently skipping FIVE places: install/lib-i18n.sh language picker install/lib-preflight.sh preflight checks install/lib-hooks.sh hook activation prompt install/lib-wizard.sh sleep wizard install.sh:270 PATH wiring bootstrap.sh kei-onboard primary CLI picker bootstrap.sh launch prompt "запустить kei сейчас?" Per rules/tty-interactivity-gate.md the rule is "gate on stdin, never stdout" — and we did. But under curl|bash BOTH are non-tty. /dev/tty is the only reliable signal that the user is interactive. FIX: in bootstrap.sh, ONCE, before invoking install.sh: if [ -r /dev/tty ] && [ -w /dev/tty ]; then exec --- bin/kei | 2 +- bootstrap.sh | 31 +++++++++++++++++++++++-------- plugin.json | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/bin/kei b/bin/kei index 6307ede..cb69d54 100755 --- a/bin/kei +++ b/bin/kei @@ -248,7 +248,7 @@ ${C1} ██╔═██╗ ██╔══╝ ██║╚════█ ${C1} ██║ ██╗███████╗██║███████║███████╗██║${C0} ${C1} ╚═╝ ╚═╝╚══════╝╚═╝╚══════╝╚══════╝╚═╝${C0} -${C2} KeiSeiKit · substrate v0.47${C0} +${C2} KeiSeiKit · substrate v0.48${C0} ${C3} ─────────────────────────────────────${C0} primary CLI : ${CV}${PRIMARY}${C0} profile : ${CV}${p}${C0} diff --git a/bootstrap.sh b/bootstrap.sh index 6691fb2..8201a03 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -227,6 +227,19 @@ log "checkout: $KIT_DIR" # --- 5. run install ------------------------------------------------------ log "running install.sh --profile=$PROFILE $YES_FLAG ${EXTRA_FLAGS[*]:-}" cd "$KIT_DIR" + +# v0.48: reattach stdin to /dev/tty for the install + everything after. +# Under `curl|bash` stdin is the curl pipe, so install.sh's interactive +# gates (5 places: language pick, preflight, hooks-activate, sleep wizard, +# PATH wiring) all silently skip via [ -t 0 ] being false. Reattaching ONCE +# here cascades correctly: every child script inherits the terminal stdin +# and its [ -t 0 ] returns true. Only do it if /dev/tty is actually +# present and readable (CI / nohup / systemd: skip — those are headless). +if [ -r /dev/tty ] && [ -w /dev/tty ]; then + exec &2 - read -r _reply