Backspace doesn't function in irb when run inside of Git Bash.

260 views
Skip to first unread message

Andrew Pennebaker

unread,
Jan 31, 2013, 11:19:17 AM1/31/13
to rubyin...@googlegroups.com
I often use a Git Bash window instead of a Command Prompt for coding. However, irb has trouble with special characters such as Backspace in this environment--it fails to query whether the terminal is a traditional Command Prompt window or a Cygwin window.

If we added this small check in irb, and altered the terminal I/O correspondingly, irb would perform better in the complex hybrid Windows+Unix environments that Ruby developers often use.

$ specs irb ruby bash git os
Specs:

specs 0.2

irb --version
irb 0.9.6(09/06/30)

gem --version
1.8.24

ruby --version
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

bash --version
GNU bash, version 3.1.0(1)-release (i686-pc-msys)
Copyright (C) 2005 Free Software Foundation, Inc.

git --version
git version 1.8.0.msysgit.0

systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name:                   Microsoft Windows XP Professional
OS Version:                5.1.2600 Service Pack 3 Build 2600

Luis Lavena

unread,
Jan 31, 2013, 11:59:05 AM1/31/13
to rubyin...@googlegroups.com
On Thu, Jan 31, 2013 at 1:19 PM, Andrew Pennebaker
<andrew.p...@gmail.com> wrote:
> I often use a Git Bash window instead of a Command Prompt for coding.
> However, irb has trouble with special characters such as Backspace in this
> environment--it fails to query whether the terminal is a traditional Command
> Prompt window or a Cygwin window.
>

Is Git Bash window using rxvt? or is run directly on top of cmd.exe?

I believe Cygwin uses the same terminal emulator, which is broken.

> If we added this small check in irb, and altered the terminal I/O
> correspondingly, irb would perform better in the complex hybrid Windows+Unix
> environments that Ruby developers often use.
>

What small check are you talking? Perhaps you missed to include that
link or code.

The problem with this is rb-readline which is a pure-ruby Readline
implementation.

The best place to raise these issues is here:

https://github.com/luislavena/rb-readline/issues

Of course: unless you're using rxvt, which is broken.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
Reply all
Reply to author
Forward
0 new messages