jpw
jpw

Reputation: 19247

ruby irb on windows using gitbash shell - can't use arrow keys to modify command input?

when I do rails console my git bash shell permits me to use up arrow to recall commands, and use left/right arrows to modify the text I'm entering

when I run irb the shell ignores backspace and arrow keys

I'm not sure why the arrow keys would work fine in the shell for rails console but not when running irb?

Upvotes: 3

Views: 1755

Answers (4)

konyak
konyak

Reputation: 11706

As documented here https://groups.google.com/forum/#!topic/rubyinstaller/HgswOz1T-eE, use the below command/alias:

alias irb="ruby -S irb"

Upvotes: 1

Michael Foster
Michael Foster

Reputation: 11

Doing the following command fixed the problem for me on Windows

gem install wirble win32console

Upvotes: 1

Neno Ganchev
Neno Ganchev

Reputation: 746

As I just wrote in the related Backspace and arrow keys aren't working in IRB(Git Bash console) on windows machine:

running irb with --noreadline solved this problem for me:

irb --noreadline

Upvotes: 4

David Grayson
David Grayson

Reputation: 87386

What operating system are you running? You may need install the GNU Readline Library and reinstall ruby.

Upvotes: 1

Related Questions