piotrmurach / tty-prompt

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

help_color not working for multi_select #122

Closed pjvleeuwen closed 4 years ago

pjvleeuwen commented 4 years ago

Describe the problem

The default help_color given to the Prompt constructor is used for select, but not for multi_select. On a first glance the intention was for multi_select to use this color, as

Steps to reproduce the problem

irb(main):001:0> require 'tty-prompt'
=> true
irb(main):002:0> @prompt = TTY::Prompt.new(help_color: :cyan)
=> #<TTY::Prompt: {:input=>#<IO:<STDIN>>, :output=>#<IO:<STDOUT>>, :prefix=>"", :active_color=>:green, :error_color=>:red, :enabled_color=>nil, :help_color=>:cyan}
irb(main):003:0> @prompt.select('Which option?', %i[first second third])
Which option? first
=> :first
irb(main):004:0> @prompt.multi_select('Which options?', %i[first second third])
Which options? first
=> [:first]

Actual behaviour

select uses help_color configured, while multi_select always shows dark gray.

Expected behaviour

The expected behaviour is for both classes to use help_color. I expect this, because MultiList#render_header seems to decorate based on inherited @help_color.

Describe your environment

LOCAL GEMS

tty-color (0.5.0) tty-cursor (0.7.0) tty-prompt (0.20.0) tty-reader (0.7.0) tty-screen (0.7.0)```

piotrmurach commented 4 years ago

Thanks for reporting! ❤️ Do you have time to submit PR to fix this?

pjvleeuwen commented 4 years ago

Not sure yet...

pjvleeuwen commented 4 years ago

I have not before worked on such ruby project. I just write scripts which I run with the ruby command from a docker container. Could you please write out some steps I need to take to get up and running? E.g. apt install this and that, then run this and that to build / run tests.

slowbro commented 4 years ago

This was fixed in #119 (9f72d62).