piotrmurach / tty-prompt

A beautiful and powerful interactive command line prompt
https://ttytoolkit.org
MIT License
1.47k stars 136 forks source link

multi-select help color #118

Closed robbystk closed 4 years ago

robbystk commented 4 years ago

Description

a multi_select prompt doesn't respect the help_color option

Steps to reproduce the problem

require 'tty-prompt'

prompt = TTY::Prompt.new(help_color: :cyan)

# yes uses the `help_color` set above
prompt.yes?('Do you like ruby?')

# but `multi_select` does not
prompt.multi_select('pick_one', help_color: :cyan) do |q|
  q.choice :a
  q.choice :b
  q.choice :c
end

Results

Despite setting help color in two places, the text comes out in the default color:

Screen Shot 2019-12-12 at 11 47 56 AM

(Note I highlighted the text because otherwise the help text is the same color as my terminal background)

Environment

Notes

I can probably provide a fix this weekend. There may be other places where :bright_black is used instead of @help_color, and similar for other colors.

piotrmurach commented 4 years ago

Thanks for fixing this issue! I will release shortly.

I scanned lib and there is only now one place with :bright_black at the prompt initialization. This is probably the least appropriate colour to use as a default but will have to suffice for now. In the near future, I wish to expand pastel to handle 256 and true colour terminals.