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

Does not support CTRL-U in password mode #43

Closed
gutenye opened this issue Aug 27, 2012 · 6 comments · Fixed by #260
Closed

Does not support CTRL-U in password mode #43

gutenye opened this issue Aug 27, 2012 · 6 comments · Fixed by #260

Comments

@gutenye
Copy link

gutenye commented Aug 27, 2012

Type "helloCTRL-Uworld"

ask("Usrename: ")                            -> "world"
ask("Password: "){|q| q.echo = false}  -> "hello\x15world"
@JEG2
Copy link
Owner

JEG2 commented Aug 27, 2012

Wow, you really type passwords like that? :)

It's true that we have to setup some special terminal modes to avoid echoing the password. That swallows some key combinations. I have found that to be a problem thus far, but I'll take patches from people it bothers who can find a way around it.

@abinoam
Copy link
Collaborator

abinoam commented Feb 5, 2015

Hi @gutenye , just to be sure I'm understanding correctly. Are you expecting HighLine to "delete" all the line and come back to "home", so it would return only "world", not "hello\u0015world" ?

If so, I think we could try to do this.
But, should we try to emulate all control keys from the terminal?

For most common purposes of the echo = false use cases, handling backspace correctly is enough.

@JEG2
Copy link
Owner

JEG2 commented Feb 5, 2015

Yeah, I'm not sure how much it's HighLine's responsibility to emulate full terminal behavior. It seems weird to me that a simple HighLine call might erase my terminal screen.

We are currently planning the next major version of HighLine. We will include a discussion of where to draw these lines in the plans we make for that release.

@gutenye
Copy link
Author

gutenye commented Feb 5, 2015

Are you expecting HighLine to "delete" all the line

Yes, that's what I wanted.

@abinoam
Copy link
Collaborator

abinoam commented Jan 6, 2023

Hi @gutenye,

Most projects that I know just delete (deprecate) old issues. But it's not the case here in HighLine. We don't give up! 😄
This issue has more than 10 years! Oh - MY - GOD!

The first release of "io/console" was 0.3 at October 16, 2011 (6,5 KB). But, not mature, and in a time that some of the releases were yanked.

The first "usable" release that I have notice is 0.4.1 at February 04, 2013 (8,5 KB) AFTER the opening of this issue.

You can see the whole release history at https://rubygems.org/gems/io-console/versions

The good news is that we currently have an "io/console" more mature with more features we could rely on so we don't have to take all the responsibilities for the console inside HighLine's code.

I've just merged a PR that solves handling "CTRL-C" by relying on "io/console" functionalities that were released with Ruby version 2.7.0 at December, 2019 (when this issue had 7 years old.
Then I remembered about this old issue over here and this improvements in "io/console" gave me some hope.
I can't promise, but I'll be trying to solve it.

Is there any GitHub badge for solving a 10 years old issue? 😄

Hey @JEG2 keep an eye on this? Perhaps we take a picture of an "anniversary cake" for the issue.

@abinoam
Copy link
Collaborator

abinoam commented Jan 7, 2023

It was easier to treat CTRL-U as we are treating backspace now than to rely on io/console. Basically because of things like the possibility of echo = '*' for example, or question.limit. But we surely have to transition on to relying on io/console for everything it is possible now. Se PR #260

abinoam added a commit that referenced this issue Jan 7, 2023
Fix #43 - Ctrl-U (erase line) handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants