Keep the Copy URL migration's browser prompt visible (#6842)

gum draws its confirm UI on stderr, so the migration's `2>/dev/null` threw
away the whole prompt while gum still held the terminal in raw mode reading
keys. With a browser open, an update stopped after "Running migration
(1786643346)" on an unpainted screen with no way to tell it was waiting for
an answer.

Nothing else in the repo suppresses gum's stderr; the redirect only ever hid
gum's own error in the no-terminal case, where the migration already explains
itself on stderr before deferring.

Fixes #6841


Claude-Session: https://claude.ai/code/session_01So4yKzTDdJJp7orjnF8i1J

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Adrian Rangel
2026-08-14 08:19:25 +02:00
committed by GitHub
co-authored by Claude Opus 5
parent 5e5197a081
commit df708831b6
2 changed files with 21 additions and 5 deletions
@@ -45,6 +45,20 @@ run_migration && fail "migration defers while a browser is running"
fail "migration leaves preferences alone while a browser is running"
pass "migration defers the repair while a browser is running"
# gum paints its prompt on stderr, so that stream has to stay attached:
# suppressing it leaves gum reading keys behind an unpainted screen, which
# reads as a hung update.
cat >"$stub_bin/gum" <<'STUB'
#!/bin/bash
echo "gum-prompt-painted" >&2
exit 1
STUB
prompt_stderr="$test_dir/prompt-stderr"
HOME="$home" PATH="$stub_bin:$PATH" bash -euo pipefail "$migration" >/dev/null 2>"$prompt_stderr" &&
fail "migration defers when the browser prompt is declined"
grep -q "gum-prompt-painted" "$prompt_stderr" || fail "migration keeps the browser prompt visible"
pass "migration keeps the browser prompt visible"
# Confirming the prompt after closing the browser lets the repair proceed.
cat >"$stub_bin/gum" <<'STUB'
#!/bin/bash