It seems that irb has problems with the arrow keys on Windows. Steps to
reproduce:
Start up CMD.
Type “irb” and press return
Type “abc” and do not press return
Press the right arrow key
Now try typing “defg” - the characters don’t show up anymore. If you
press return followed by the up arrow key, the whole sequence you typed,
including the mysteriously invisible characters, shows up.
I’m using ruby 1.9.2p0 (2010-08-18) [i386-mingw32] on Windows Vista
32-bit, installed by extracting the 7z archive provided by the
RubyInstaller team to C:\Rubies\ruby-1.9.2-p0-i386-mingw32. Of course I
added the bin\ subdirectory to my PATH variable.
I don’t know wheather in matters, but I don’t have the RubyInstaller’s
devkit installed, but a separate MinGW+MSYS installation in C:\MinGW
which is up-to-date.
On Sun, Nov 7, 2010 at 12:40 PM, Marvin Gülker [email protected] wrote:
press return followed by the up arrow key, the whole sequence you typed,
including the mysteriously invisible characters, shows up.
This also happens in PowerShell / Windows 7 Professional.
Hitting enter after the above steps reveals that the “d” gets
swallowed up, however, and only “abcefg” are being processed.
–
Phillip G.
Though the folk I have met,
(Ah, how soon!) they forget
When I’ve moved on to some other place,
There may be one or two,
When I’ve played and passed through,
Who’ll remember my song or my face.
Hitting enter after the above steps reveals that the “d” gets
swallowed up, however, and only “abcefg” are being processed.
You’re right, I didn’t even notice that. What is even worse, is trying
to use irb within the MSYS bash:
Start up bash
Type “irb” and press return
Type “abcdef” and press return
Press the up arrow key
Press the down arrow key
Press up again: Now you’ve got your previous line twice! You can
repeat this process as often as you want, the line keeps getting longer
and longer.
(Hopefully these steps are correct, I just wrote them down from memory
as I don’t have access to the Vista machine for some time now).
As a side note: I usually don’t use CMD directly on Windows, because
it’s kind of difficult to manage all these shells in different windows
(sometimes I run irb, MSYS bash, CMD and Cygwin bash simultanously).
Therefore I’m using Console2, which may explains some odd input
behaviour.
Press up again: Now you’ve got your previous line twice! You can
repeat this process as often as you want, the line keeps getting longer
and longer.
(Hopefully these steps are correct, I just wrote them down from memory
as I don’t have access to the Vista machine for some time now).
Unable to reproduce, Ruby 1.9.2-p0, 1.8.7-p302
Windows 7, x64. using default command prompt (cmd.exe) or MSYS bash.
As a side note: I usually don’t use CMD directly on Windows, because
it’s kind of difficult to manage all these shells in different windows
(sometimes I run irb, MSYS bash, CMD and Cygwin bash simultanously).
Therefore I’m using Console2, which may explains some odd input
behaviour.
I’m using it too and don’t see the odd behavior you’re describing.
press return followed by the up arrow key, the whole sequence you typed,
including the mysteriously invisible characters, shows up.
I’m using ruby 1.9.2p0 (2010-08-18) [i386-mingw32] on Windows Vista
32-bit, installed by extracting the 7z archive provided by the
RubyInstaller team to C:\Rubies\ruby-1.9.2-p0-i386-mingw32. Of course I
added the bin\ subdirectory to my PATH variable.
What codepage (chcp) are you using?
I’m not been able to reproduce this, as responded to this thread
already.
I don’t know wheather in matters, but I don’t have the RubyInstaller’s
devkit installed, but a separate MinGW+MSYS installation in C:\MinGW
which is up-to-date.
Not unless you’re running inside a bash terminal, but even that should
not affect it.
press return followed by the up arrow key, the whole sequence you typed,
Anyone experiencing the same problem?
This is a bug of rbreadline.
Here is a patch for rbrealine.rb
— rbreadline.rb 2010-11-08 10:10:28.000000000 +0900
+++ rbreadline.rb.new 2010-11-08 10:10:11.000000000 +0900
@@ -8435,21 +8435,20 @@
count -= 1
end
I’m sorry, but as I stated previously, I don’t have access to a Windows
machine for the moment (for the curious ones: It’s my only one and the
laptop it runs on had a serious problem with it’s display, so it’s away
for repair now).
As soon as I get my box back, I’ll look up which codepage it uses.
I’m using ruby 1.9.2p0 (2010-08-18) [i386-mingw32] on Windows Vista
32-bit, installed by extracting the 7z archive provided by the
RubyInstaller team to C:\Rubies\ruby-1.9.2-p0-i386-mingw32. Of course I
added the bin\ subdirectory to my PATH variable.
I don’t know wheather in matters, but I don’t have the RubyInstaller’s
devkit installed, but a separate MinGW+MSYS installation in C:\MinGW
which is up-to-date.
Datapoint: I’m unable to reproduce this.
Environment:
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32] (installed using
executable installer downloaded from RubyInstaller.org)
Windows XP SP3, 32 bit
default command shell (cmd.exe)
ruby 1.8.7 (2010-01-10 patchlevel 249) [i386-mingw32] (installed using
executable installer downloaded from RubyInstaller.org)
Windows XP SP3, 32 bit
default command shell (cmd.exe)
Note: couldn’t reproduce it with Windows PowerShell either.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.