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

Backspace not working #16

Closed
cfbrobak opened this issue Nov 7, 2011 · 9 comments
Closed

Backspace not working #16

cfbrobak opened this issue Nov 7, 2011 · 9 comments

Comments

@cfbrobak
Copy link

cfbrobak commented Nov 7, 2011

Environment:

  • jruby 1.6.5 (ruby-1.8.7-p330) (2011-10-25 9dcd388) (Java HotSpot(TM) Client VM 1.6.0_21) [Windows XP-x86-java]
  • highline (1.6.5)

Scenario:

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'highline/import'
=> true
irb(main):003:0> ask("Password:  ") { |q| q.echo = "*" }
Password:  *****
=> "12345"
irb(main):004:0> ask("Password:  ") { |q| q.echo = "*" }
Password:  *****You must enter a valid HighLine::String.
?
=> ""

Line 3 prompts for a password and "12345" is entered. It works as expected.
Line 4 prompts for a password and "12345" followed by a "backspace" is entered. Highline responds with an error "You must enter a valid HighLine::String".

Claus

@JEG2
Copy link
Owner

JEG2 commented Nov 7, 2011

The backspace key is working for me, so it must depend on how input is being gathered.

Can you tell me what this prints for you?

p HighLine::SystemExtensions::CHARACTER_MODE

@cfbrobak
Copy link
Author

cfbrobak commented Nov 8, 2011

Output is this:

irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'highline/import'
=> true
irb(main):003:0> p HighLine::SystemExtensions::CHARACTER_MODE
"Win32API"
=> nil
irb(main):004:0>

Claus

@astounding
Copy link

This issue looks VERY similar to issue 17 #17 which was a problem with a missing ERASE_LINE constant. I submitted a pull request that is one way to fix my issue (and if these two issues are really the same issue, it might fix this too).

Then again, as this one isn't setting the overwrite, they are likely different. But the error message with both is identical.

@JEG2
Copy link
Owner

JEG2 commented Nov 14, 2011

I have release HighLine 1.6.6 with your fix in it. Does that solve this issue for you?

@astounding
Copy link

My pull request (issue 18) contained one mistake. The argument to HighLine.Style() was a string when it should have been a symbol. I just submitted a new pull request (issue 19) to correct my mistake. Sorry about that!

@JEG2
Copy link
Owner

JEG2 commented Nov 14, 2011

I've released 1.6.7 with the new fix. Please let me know if it solves this issue.

@astounding
Copy link

1.6.7 fixes my problem (issue #17, 18, and 19). Thank you! When I try cfbrobak's example code, I do not get an error, but I am not running JRuby.

@astounding
Copy link

Ah, I think I found cfbroback's problem.... the ERASE_CHAR constant no longer exists. I just submitted pull request (issue #20) that fixes it by replacing ERASE_CHAR with HighLine.Style(:erase_char).code I bet that will fix this issue (#16).

JEG2 added a commit that referenced this issue Nov 14, 2011
Fix for missing constant ERASE_CHAR (issue #16)
@JEG2
Copy link
Owner

JEG2 commented Nov 14, 2011

I've release 1.6.8 with this new fix, so I'm going to assume this is now solved. Just open a new issue if that's not the case.

@JEG2 JEG2 closed this as completed Nov 14, 2011
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

3 participants