I am trying to use the HighLine library for password prompting on
Windows and cannot make it work properly.
Environment:
- Windows XP SP3
- ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
- highline 1.6.9
Program:
require 'rubygems'
require 'highline/import'
p ask('Password: ') { |q| q.echo = '*' }
Problem:
When entering “12345” + Backspace twice + Enter at the prompt I get:
W:\work> ruby tst.rb
Password: ****←[←[P
"123"
When entering “12345” + Left Arrow twice + Enter at the prompt I get:
W:\work> ruby tst.rb
Password: *********
"12345\xE0K\xE0K"
This is not exactly what I was hoping for. If using HighLine with JRuby
the problem is more or less the same. Am I missing something or is
this a bug/limitation of HighLine?
Claus