Solved

backspace problem in cygwin

Posted on 2003-10-25
9
4,804 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
  • 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

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.
In our personal lives, we have well-designed consumer apps to delight us and make even the most complex transactions simple. Many enterprise applications, however, are a bit behind the times. For an enterprise app to be successful in today's tech wo…
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

809 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