diff --git a/commands/confirm b/commands/confirm index 555ef1d33..d77d55e42 100755 --- a/commands/confirm +++ b/commands/confirm @@ -214,6 +214,7 @@ function confirm_() ( # renders local options_unselected=() options_selected=() options_results=() selected_index='' selectable_count selectable_last yes_index no_index='' abort_index if test "$option_mode" = 'positive' -o "$option_mode" = 'negative' -o "$option_mode" = 'bool'; then + # if it appears dim, it is because your terminal theme has changed and you haven't opened a new terminal tab if is-color-enabled --; then options_selected+=( "$(echo-style "$legend_indent" --invert+legend+green+bold=' YES ' --key+green+bold='Y')" diff --git a/commands/read-key b/commands/read-key index 704e8b80d..00fa1b262 100755 --- a/commands/read-key +++ b/commands/read-key @@ -250,11 +250,11 @@ function read_key() ( local inputs='' input='' last_key='' if (: /dev/tty) &>/dev/null; then # is-tty but copied for performance - function discard_key_if_line_buffer_enter { + function __discard_key_if_line_buffer_enter { return 1 } else - function discard_key_if_line_buffer_enter { + function __discard_key_if_line_buffer_enter { test "$input" = $'\n' -a -n "$last_key" -a "$last_key" != $'\n' } fi @@ -266,7 +266,7 @@ function read_key() ( if test "$input" = $'\e' -o "$input" = $'\n'; then flush fi - if discard_key_if_line_buffer_enter; then + if __discard_key_if_line_buffer_enter; then if test "$option_keep_line_buffer_newlines" = 'yes'; then printf '%s\n' 'line-buffer' fi