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

Support Ctrl+A, Ctrl+E and Ctrl+W in read_line #25

Open
jeremie-stripe opened this issue May 12, 2022 · 1 comment
Open

Support Ctrl+A, Ctrl+E and Ctrl+W in read_line #25

jeremie-stripe opened this issue May 12, 2022 · 1 comment

Comments

@jeremie-stripe
Copy link

Describe the problem

A potential suggestion/feeling check before I go ahead and try to contribute. We have a user of our CLI tool (which uses shiny TTY::Prompt) that was asking to be able to use the classic Ctrl combination for navigation and editing of a prompt.ask (Ctrl+A to go at the start of a line, Ctrl+E for end and Ctrl+W to erase the prefilled value).

How would the new feature work?

My instinct would be that we just need to add those 3 cases I mention in

elsif key_name.to_s =~ /ctrl_/
# skip
to mirror the currently handling that's done with :home, :end and add one for erasing.

Drawbacks

Not sure if handling this would cause ripple effects through some other systems that expect it to be available.

@jeremie-stripe jeremie-stripe changed the title Support ctrl+A,ctrl+E,ctrl+W in read_line Support Ctrl+A, Ctrl+E and Ctrl+W in read_line May 12, 2022
@coezbek
Copy link

coezbek commented Sep 27, 2024

I guess the question is if this is an desired capability for tty-reader considering the text from the Readme: "The tty-reader is not compatible with the GNU Readline and doesn't aim to be. "

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

2 participants