Solved

backspace problem in cygwin

Posted on 2003-10-25
9
4,890 Views
Last Modified: 2013-11-15
I want to use cygwin in windows XP, but there is a problem with backspace key
it doesn't work like backspace in windows (backspace removes character before cursor position)

what should i do to make backspace key work like in windows?

thank
0
Comment
Question by:nk2003
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 6

Expert Comment

by:durindil
ID: 9623045
stty erase (type backspace key)

If should look like this:

# stty erase ^h
0
 

Author Comment

by:nk2003
ID: 9624689
where should i type that command?
when i tried to type in cygwin prompt,  i tried "stty erase <press backspace key>" but i didn't show ^h, it just moved the curcor, 1 step to the left

0
 

Author Comment

by:nk2003
ID: 9624710
sorry I forgot something, the problem is not in cygwin prompt, but when I use VIM
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 20

Expert Comment

by:Gns
ID: 9626651
Vim will use your terminals (cygwin in this case) defenition of erase, so the advice above is valid.
What value has erase? View it with
stty -a
at the bash prompt.
If you are unsure of what the backspace key generates, type
<ctrl>-<v><Backspace>
at the bash prompt.

You might also want to look at ":map"/":map!" .... ":help map" might be a start.

-- Glenn
0
 

Author Comment

by:nk2003
ID: 9627058
I had tried <ctrl>-<v><Backspace>, but it result is ^? (not ^h)
is it correct?
but it didn't solve the problem...


here is result from "stty -a": (maybe usefull)

$ stty -a
speed 38400 baud; rows 43; columns 125; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo -echoe -echok -echonl -noflsh -tostop -echoctl -echoke
0
 
LVL 20

Expert Comment

by:Gns
ID: 9627296
>I had tried <ctrl>-<v><Backspace>, but it result is ^? (not ^h)
Shows that your backspace key generates DEL (delete) instead of backspace (^h)
But since stty -a show that you have
> erase = ^?;
you _should_ be fine with this. In vim, the :map command could show what mappings are in effect. If ^? is interpreted as del, and not as backspace, this might explain your problems.
Do you have an .exrc or .vimrc file? Content? I'd suspect not, but there ($HOME/.vimrc) is perhaps where you should put the following
:set t_le=^?
(note that you need generate the DEL character with <Ctrl>-<v><your DEL/backspace key>, so that it is one character and not two as in <^><?>)

You can check the value of t_le in vim by the
:set termcap
command, and you can test that the line above works there too, before putting it in a .vimrc file.

-- Glenn
0
 

Author Comment

by:nk2003
ID: 9627468
great, It solved the probem, but it cannot remove the end of line

for example:
abcdefghij
klmnopq_  

(_ : cursor)
when I use backspace (at that cursor position), it removed klmnopq
but when i press backspace again, the cursor didn't move to upper line (after j character)

what should i do?
0
 
LVL 20

Accepted Solution

by:
Gns earned 125 total points
ID: 9627636
Read the docs:-) :help is there for you:-):-). ":help set" will show some, and also look at examples in /usr/share/vim/vim61/vimrc_example.vim (or similar).

Actually, to allow "backspacing" to delete lines you might add
set backspace=indent,eol,start
to your .vimrc file.

-- Glenn
0
 

Author Comment

by:nk2003
ID: 9627684
thank you....
very good explaination...
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your app took Google’s lash recently, here are the 5 most likely reasons.
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question