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

Move hardware cursor to selection in select/multi_select #54

Open
guilevi opened this issue May 25, 2017 · 6 comments
Open

Move hardware cursor to selection in select/multi_select #54

guilevi opened this issue May 25, 2017 · 6 comments

Comments

@guilevi
Copy link

guilevi commented May 25, 2017

The hardware cursor is not moved to the focussed option in select and multi_select, which causes problems in software such as terminal screenreaders for the blind.

require 'tty'
p=TTY::Prompt.new
p.select("Choice?", %w(First Second Third))
@piotrmurach
Copy link
Owner

Hey Guillem,

Thank you for using this lib! I'd definitely like to fix the situation. I think this is due to the fact that I'm using escape codes to actually hide the cursor and replace it with visual arrows etc... I will see if I can provide an option to allow to toggle this behaviour. I will need your help with testing if possible.

@guilevi
Copy link
Author

guilevi commented Jul 19, 2017 via email

@piotrmurach
Copy link
Owner

I had a bit more in depth look at this issue and there isn't an easy fix. The whole logic for painting these menus relies on moving the cursor relative to its current position which always ends up being the last painted string regardless of the currently marked option. I'm not saying I won't work on it but it is far more convoluted than I've expected. Please bear with me.

@lflucasferreira
Copy link

Till now this issue was not fixed. I don't know what to do about this problem.

@lflucasferreira
Copy link

I figured out that this happens when I use bash in VS Code. In Windows CMD it is working fine as well in Cmder.

@piotrmurach
Copy link
Owner

@lflucasferreira I hope you don't mind me asking but are you visually impaired? Is this issue affecting your use of assistive technology such as terminal screen readers as discussed in this issue? Is that why you're frustrated? As I explained in the previous answer the 'fix' would require a significant update for which I'm struggling to find the time. Do you have time to help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants