Skip to content

Commit

Permalink
Fix get input issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Oct 25, 2024
1 parent 18cf050 commit 9da511b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,21 @@ setup_ai_provider() {
local default="$2"
local is_password="$3"
local placeholder="$4"

gum style --foreground="#CCCCCC" "$prompt"
[ -n "$default" ] && gum style --foreground="#888888" "Default: $default"


# Print prompts to stderr so they don't get captured in variable assignment
echo >&2
gum style --foreground="#CCCCCC" "$prompt" >&2
[ -n "$default" ] && gum style --foreground="#888888" "Default: $default" >&2

local input_args=(
--value "${default:-}"
--placeholder "$placeholder"
--prompt "> "
--prompt.foreground="#00FFFF"
)
[ "$is_password" = "true" ] && input_args+=(--password)


# Only return the actual input value
gum input "${input_args[@]}"
}

Expand Down

0 comments on commit 9da511b

Please sign in to comment.