Backspace and arrow keys aren't working in IRB(Git Bash console) on windows machine
Same thing happened to me. Running irb with --noreadline solved my problem:
irb --noreadline
Tab completion and arrow keys don't work in GHCI in Git Bash
Not having received any responses here, I cross-posted the question to the project's GitHub repository.
Apparently, this issue seems to be related to the mintty terminal emulator. If you instead install Git Bash with the ConHost emulator, the problem goes away.
backspace does not work git bash
I had this same problem today after switching to mintty with a fresh version of git. In my case, it was an old .bashrc file I'd been carrying around for many years with the line export TERM=ansi
. After removing that and starting a new bash, everything works again.
More generally, to debug, I was suspicious of all the dot-config stuff in my home directory--so I moved things like .bash_profile, .bashrc, .inputrc, etc. into a temporary directory where they wouldn't be read by bash. Then, I started bash and saw that it worked. I mention it because, if it isn't specifically the TERM issue I had, you might be able to debug using the same technique.
Why does hitting the left arrow in irb give me ^[[D ?
You need to do:
sudo apt-get install libreadline-dev
and then reinstall ruby and irb.
How to format irb command prompt
The irb
man page has a section on "Customizing prompt". Here's mine for example:
IRB.conf[:PROMPT][:CUSTOM] = {
:PROMPT_I => ">> ",
:PROMPT_S => "%l>> ",
:PROMPT_C => ".. ",
:PROMPT_N => ".. ",
:RETURN => "=> %s\n"
}
IRB.conf[:PROMPT_MODE] = :CUSTOM
IRB.conf[:AUTO_INDENT] = true
To use this, add it to your ~/.irbrc
file (creating it if it doesn't exist.)
Related Topics
Sinatra - Response.Set_Cookie Doesn't Work
Heroku App Fails to Start - 'Require': No Such File to Load -- Sinatratestapp (Loaderror)
How to Get the Version from a Gemspec File
Changing Active Model Serializers Default Adapter
Testing After_Commit with Rspec and Mocking
Check If a File Exists Using a Wildcard
Star Rating in Ajax with Ruby on Rails
Why Is Devise Not Displaying Authentication Errors on Sign in Page
Aptana 3 Ruby Debugger - Exception in Debugthread Loop: Undefined Method 'Is_Binary_Data'
Rails Console Not Working on Server
Ruby Undefined Method 'Bytesize' for #<Hash:0X2954Fe8>
Using Soap and Other Standard Libraries in Ruby 1.9.2
Can a Ruby Script Tell What Directory It's In
Migrating Data - Not Just Schema, Rails
How to Tokenize This String in Ruby
Don't Have Jekyll-Paginate or One of Its Dependencies Installed