[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

backspace problem in cygwin

Posted on 2003-10-25
9
Medium Priority
?
4,979 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
Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

 
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 500 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
Have you ever run into that annoying problem where the computer won't boot?  Wouldn't it be great if you had a tool that would make that disk boot again?  I have found one tool that works more often than not ...
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…
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

656 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