-
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
Problem getting character in highline on git bash (via MINGW) on windows #175
Comments
Could you try the prerelease version? gem install highline --pre Em Seg, 2 de nov de 2015 12:37, otbster [email protected] escreveu:
|
Ok I've tried the prerelease version. With the following simple piece of code:
In version 1.6.21, this works fine in powershell or the command prompt, but hangs in git bash (using MINW). In version 2.0.0-prerelease, this again works fine in powershell or the command prompt. In git bash, I get the following error: Password: C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/highline-2.0.0.pre.develop.2/lib/highline/terminal/io_console.rb:17:in (Also, I say it works fine in powershell, but the normal ctrl-c to terminate execution doesn't seem to work in either version while getting a password as above - it has no effect, except for adding a funny extra character to the password). |
Hi @otbster , Although I couldn't reproduce it the same way you did, your report makes a lot of sense. ruby -e "require 'io/console'; STDIN.echo = false; a = gets; puts a" Unfortunately, I will not have much time to try to fix this for at least these next 2 weeks. Thanks for reporting, as soon as I have a fix I'll contact you. |
Could you copy/past here the output of these two commands? ruby -e "puts RUBY_DESCRIPTION"
ruby -e "puts RUBY_PLATFORM" |
Thanks! Actually I think this was my fault - I just updated git (for a different reason) and during installation it says, if you select the MinTTY emulator for git bash (which is what I use), that windows console programs may not work on it, and you should use "winpty" to run them. When I then ran So the moral is, pay attention to installation instructions, and use winpty when running windows programs from the MinTTY. For what it's worth, my RUBY_DESCRIPTION is "ruby 2.0.0p0 (2013-02-24) [x64-mingw32]" and my RUBY_PLATFORM is "x64-mingw32" |
Thank you very much for reporting the fix. It will be useful for others that fight the same issue in the future. When I have some time I'll try to work on some "autodetect" features. |
So I may be the only person who has ever had this problem.
I was trying to run a ruby script (to set up an open shift webserver) on git bash (my normal terminal), on windows. It consistently hung at the getting password stage.
Eventually I worked out that the script was using highline, and that, probably due to running git bash on windows (via MINGW), the get_character method was hanging (trying to access windows functions that weren't available or something maybe). Running the script in powershell made it work just fine.
I understand this may be a niche problem.. I just wondered if you were aware of it (/if it would be easy to fix or do something about)
The text was updated successfully, but these errors were encountered: