Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I just installed Cygwin and the BACKSPACE functionality is not there, i.e. when I hit the Backspace key, I get a space. I've been trying to research this issue on Google, but did not find anything conclusive.

Hoped fellow stack*overflow* mates could help with specific solutions/directions.

Thanks in advnace!

share|improve this question

migrated from stackoverflow.com Nov 7 '11 at 10:16

This question came from our site for professional and enthusiast programmers.

    
Can you give more details of how you installed and invoked Cygwin, and where exactly the backspace key fails to work? –  ak2 Aug 30 '11 at 14:40
1  
I'm guessing this is happening in the shell. What happens when you type control-V followed by backspace? And what's the output of the stty command? –  Keith Thompson Aug 30 '11 at 17:57
    
What sort of keyboard do you have? US, UK etc. –  pjc50 Nov 7 '11 at 10:26
    
Did you ever resolve this? I'm seeing it now on my new Cygwin install, though it previously worked. It's worth noting that you aren't getting "a space": It's failing to move the cursor back to erase the character. The space you're seeing is the space that was supposed to stomp on the previous character. If you hit ^L you can see that backspace IS working. This is why stty isn't fixing things. It's almost like the CMD shell that Cygwin is bound to is failing to interpret cursor movement. –  SomeCallMeTim Mar 19 '12 at 22:30

8 Answers 8

In my case backspace was not at all working after creating blank ~/.vimrc. Following change made it work

Put:

set bs=2

in .vimrc

Found this at http://linux-journal.blogspot.com/2005/04/fix-vim-backspace-doesnt-work.html

share|improve this answer
    
Thank you, this worked for me -- previously, in Vim, my backspace key was moving back along the line but was not clearing the letters until I started typing. Now it does the 'usual' backspace. –  Robert Mar 18 '13 at 11:50
    
Thank you thank you thank you. –  Albert Xing Nov 1 '13 at 23:53
2  
It's great that this answer helped some other users, but in this case it's not the solution to the question since the original question isn't asking about vim. –  Kelsin Mar 6 at 7:34

I found a solution to a problem that presented like the one above.

Simply run Cygwin setup again and reinstall termcap and terminfo. If you use the search box you can find them quickly. Instead of saying "Keep" for each, click it to make it say "Reinstall". You may have to check the "Hide Obsolete" checkbox for term to appear in the search.

My terminfo folder was entirely missing. No idea why. Hope this helps someone.

share|improve this answer
1  
I had a custom installed ncurses, that I removed. After removing and reinstalling via cygwin setup.exe I had this problem. I don't want to apply a bandaid by setting TERM variables to something other than what was working before my mishap. Reinstalling terminfo (I couldn't find termcap) worked for me. Thanks! –  Kelsin Mar 6 at 7:32

Worked for me: In the Windows command prompt, type

echo export TERM=cygwin >> C:/cygwin/home/YourUser/.bashrc

This will add it to the .bashrc and everything may work nicely!

share|improve this answer
    
I had the TERM environment variable set to msys via the Windows environment variable settings as suggested on StackOverflow to help with git problems on Windows. Simply resetting it to cygwin in .bashrc didn't help, but removing the TERM entry from the Windows settings did. Thanks for pointing me into the right direction! –  Florian Brucker Jul 26 '13 at 9:01

Edit your c:\cygwin\cygwin.bat

Place this: SET TERM=cygwin

before: bash --login -i

share|improve this answer
    
The simplest fix by far. Hope there are no side-effects. –  romkyns Oct 2 at 23:43

Never experienced your problem. Try to install the Terminal Emulator Mintty (http://code.google.com/p/mintty/).

It's available through the Cygwin installer. Best Terminal for cygwin.

share|improve this answer
    
This did not help. –  user620189 Aug 30 '11 at 14:45
    
Even am stuck on the same issue and from minty also backspace functionality is not working. I get space when i hit backspace on both minty terminal as well as cygwin terminal –  Rachel Dec 9 '11 at 17:03
    
@Rachel Did you ever resolve this? I'm seeing the same issue with a fresh Cygwin install. :( –  SomeCallMeTim Mar 19 '12 at 22:31
    
@SomeCallMeTim: I was able to fix this issue by using Minty, cygwin behaves in very wierd manner at times. –  Rachel Mar 20 '12 at 13:33
    
@Rachel Thanks, though I found out that my problem was that the Cygwin install missed some important files (like /usr/lib/terminfo). I don't know why they were missing; found someone else with that issue, went into setup and told terminfo and termcap to reinstall, and everything worked. –  SomeCallMeTim Mar 27 '12 at 22:39

Ok, I had this issue with manually updating a Cygwin install. Anyway I found this post, which lead me to the solution for my install.

The older cygwin had a file /etc/terminfo/c/cygwin, but in the newer cygwin it expected the file to be /etc/terminfo/63/cygwin.

Once I copied the "cygwin" file to this location, the bash shell backspace key worked fine, as did tab and others.

share|improve this answer

Changing the TERM variable to cygwin and adding SET TERM=cygwin to the .bat file didn't work for me, but I fixed it. Here what I did: In package manager due installation I selected to install xterm: X11 terminal emulator, after installation I added SET TERM=xterm to the .bat file (like proposed above), launched terminal and in Options -> Terminal menu selected Type=xterm, then restarted terminal. Backspace started to work correctly!

Note: if you already installed cygwin – just run installer again and add xterm package.

I'm running:

  • OS = Windows 8 (x64)
  • Cygwin setup.exe version = 2.850 (x64)
  • Mitty version = 1.2-beta1 (x86_64-pc-cygwin)
share|improve this answer

I agree with all the answers here. But there is a far simpler way found here: http://lifepluslinux.blogspot.in/2014/08/backspace-doesnt-work-in-vim-on-cygwin.html

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.