Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wait_for_user_input in lib/cli/ui/prompt/interactive_options.rb raises interupt on left and right inputs #63

Closed
cFire opened this issue Mar 31, 2019 · 0 comments

Comments

@cFire
Copy link
Contributor

cFire commented Mar 31, 2019

Minimal example to reproduce;

require 'cli/ui'

CLI::UI::Prompt.ask('A or B?') do |handler|
  handler.option('A') { puts 'A' }
  handler.option('B') { puts 'B' }
end

Pressing the left or right arrow keys cause an interrupt to be raised.
Looking at the code it seems to be caught by the else clause in the when :esc_bracket block.

Ideally left and right keypress inputs would be ignored since they're very easy to hit by mistake when navigating.

@lugray lugray closed this as completed in 7cf32c1 Mar 31, 2019
lugray pushed a commit that referenced this issue Mar 31, 2019
Fixes #63 by ignoring left and right keypresses
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant