From 042f01bd0b25db94ed4c83b64a91439e295e4445 Mon Sep 17 00:00:00 2001 From: Timo Reymann Date: Thu, 16 Feb 2023 11:56:03 +0100 Subject: [PATCH] fix: Fix empty line for checkbox and list prompt --- src/prompts.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/prompts.sh b/src/prompts.sh index eeddf15..ee11a58 100644 --- a/src/prompts.sh +++ b/src/prompts.sh @@ -119,11 +119,10 @@ confirm() { # echo "Your choice: ${options[$option]}" list() { _prompt_text "$1 " - echo "" >&2 local opts=("${@:2}") local opts_count=$(($# -1)) - _new_line_foreach_item "${opts[@]}" + _new_line_foreach_item "${opts[*]}" # determine current screen position for overwriting the options local lastrow; lastrow=$(_get_cursor_row) @@ -177,11 +176,10 @@ list() { # echo "Your choices: ${checked}" checkbox() { _prompt_text "$1" - echo "" >&2 - + local opts; opts=("${@:2}") local opts_count; opts_count=$(($# -1)) - _new_line_foreach_item "${opts[@]}" + _new_line_foreach_item "${opts[*]}" # determine current screen position for overwriting the options local lastrow; lastrow=$(_get_cursor_row)