4

I'm using rxvt.exe, the alternative to bash.exe that comes with msysgit. My OS is WinXP.

I invoke the console with "C:\Program Files\Git\bin\rxvt.exe" -e /usr/bin/bash --login -i

The backspace key deletes everything backward to the beginning of the line, rather than just one char back.

I've experimented using things like

'bind "C-e":backward-delete-char' just to see if I can bind the behavior to a ctrl sequence, and that works, but I can't figure out how to bind with the backspace key.  I've tried binding to e\14 and e\08, but they don't work.

An extensive google search turned up plenty of Linux solutions but very little for rxvt on Windows, and nothing that addressed this problem.

Thanks a million to anyone who can provide an answer!

-Jill

jilbot
  • 145
  • 3
  • 9
  • Note that `rxvt.exe` is a [terminal emulator](http://en.wikipedia.org/wiki/Terminal_emulator); other similar programs are `xterm`, `wterm`, `aterm`, `gnome-terminal`, `urxvt`. `bash` is a [shell](http://en.wikipedia.org/wiki/Shell_(computing)), similar to `ksh`, `csh`, `tcsh`, `zsh`, `ash`, `dash`. The shell is _often_, but not always, used in conjunction with a terminal, but you can usually replace one or the other without troubles. – sarnold Feb 25 '12 at 02:49
  • Hmm - this shouldn't have been closed - rather moved to serverfault or super user. – Danny Staple Feb 11 '13 at 15:29

1 Answers1

7

Do I have the solution for you! Thanks for bringing this up, I've known it was a problem, but never knew how to fix it. Here you go:

  1. Start a git bash shell
  2. cd ~ (your home directory)
  3. Create a new file called .inputrc and fill it with the following:

    "\e[3~": delete-char
    # this is actually equivalent to "\C-?": delete-char
    # VT
    "\e[1~": beginning-of-line
    "\e[4~": end-of-line
    # kvt
    "\e[H":beginning-of-line
    "\e[F":end-of-line
    # rxvt and konsole (i.e. the KDE-app...)
    "\e[7~":beginning-of-line
    "\e[8~":end-of-line
    
  4. Save the file and exit, you should be able to restart with your original command, "C:\Program Files\Git\bin\rxvt.exe" -e /usr/bin/bash --login -i and use the backspace!

Inspiration for this solution is found here.

Thanks!

macduff
  • 4,655
  • 18
  • 29
  • Wow, thanks for the quick response! The solution worked really well and defined some other keys that I know I'll need! I also just came across this site: www.mingw.org/wiki/Configure_RXVT, which recommends adding '-backspacekey ^H' (no quotes) to the command line, which also works. – jilbot Feb 25 '12 at 00:19
  • 1
    Why is this question considered "off topic?" It does "relate to programming or software development in some way." A terminal emulator is a "software tool commonly used by programmers." Also, there are numerous other rxvt-related questions on SO that have not been closed. I'm new to SO so perhaps I've missed something. – jilbot Feb 29 '12 at 20:53