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

get_character waits for `Enter' #50

Closed
stomar opened this issue Nov 23, 2012 · 2 comments
Closed

get_character waits for `Enter' #50

stomar opened this issue Nov 23, 2012 · 2 comments

Comments

@stomar
Copy link
Contributor

stomar commented Nov 23, 2012

The following does not work as expected, it requires the 'Enter' key to be pressed. A couple of months ago it worked just fine.
Update: This regression was introduced with version 1.6.14.

require 'highline/system_extensions'
input = HighLine::SystemExtensions.get_character

ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
highline (1.6.15)
stty 8.13

(termios library not installed)

@JEG2
Copy link
Owner

JEG2 commented Nov 23, 2012

The behavior of this module has changed a little. You must now invoke "no echo" mode when desired:

$ ruby -e 'require "./lib/highline/system_extensions"; HighLine::SystemExtensions.raw_no_echo_mode; c = HighLine::SystemExtensions.get_character; HighLine::SystemExtensions.restore_mode; p c'

@alexch
Copy link

alexch commented Jan 25, 2013

Can we make that little incantation be toggled by a parameter to get_character instead? And are we sure it works on all platforms?

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