Skip to content

Commit 5b35b07

Browse files
committed
fix: force gum to read from /dev/tty for curl|bash compatibility
Explicitly redirect gum input/choose/confirm from /dev/tty to ensure terminal input works in curl|bash piped execution
1 parent 9eb00a0 commit 5b35b07

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/ui/gum.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ui_input() {
2121

2222
# Check if interactive and gum is available
2323
if is_interactive && command -v gum &>/dev/null; then
24-
gum input --placeholder "$placeholder" --value "$default" --prompt "$prompt "
24+
gum input --placeholder "$placeholder" --value "$default" --prompt "$prompt " < /dev/tty
2525
else
2626
# Non-interactive: use default or fail
2727
if [[ -n "$default" ]]; then
@@ -42,7 +42,7 @@ ui_choose() {
4242

4343
# Check if interactive and gum is available
4444
if is_interactive && command -v gum &>/dev/null; then
45-
gum choose "${options[@]}" --header "$header"
45+
gum choose "${options[@]}" --header "$header" < /dev/tty
4646
else
4747
# Non-interactive: return first option
4848
if [[ ${#options[@]} -gt 0 ]]; then
@@ -62,7 +62,7 @@ ui_confirm() {
6262

6363
# Check if interactive and gum is available
6464
if is_interactive && command -v gum &>/dev/null; then
65-
gum confirm "$question"
65+
gum confirm "$question" < /dev/tty
6666
else
6767
# Non-interactive: use default
6868
if [[ "$default" == "true" ]]; then

0 commit comments

Comments
 (0)