-
Notifications
You must be signed in to change notification settings - Fork 137
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
Surprising behavior for character = true resp. character = :getc with stty #53
Comments
Can you share the output of the following?
|
Same behavior with 1.9.3p327, 1.8.7p371 (using rvm) and system ruby (1.9.3p0) |
Thanks. I'll try to look into this when I get a chance. |
Small update: I finally got |
Yeah, |
fyi I was having trouble with |
Hi! I'm hitting what I think is the same problem… with Code require 'highline/import'
ask("question: ") { |q| q.character = true}
puts "text" Output
I tried |
A quick (and dirty) way to work around the issue is to prepend "\r" to the next string. require 'highline/import'
ask("question: ") { |q| q.character = true }
puts "\rtext" I'll be looking forward to fix it to the "reasonable expected behaviour". |
@carlosefonseca I've just merged the workaround into 1-7-stable and into master |
The test above now works with the manual installation of highline! Thanks! |
I am trying to get a single character from the user in a "cleaner" way than with
SystemExtensions.get_character
, which is not well documented and feels rather like a hack to me (see also issue #50).While playing around with the
echo
andcharacter
settings, I stumbled over two issues(?):character = true
andcharacter = :getc
. When to choose which? Are they supposed to behave differently or is this only an implementation detail?character = true
in the example code below (newline and indentation; examples one and three behave as expected).Output:
Code:
The text was updated successfully, but these errors were encountered: