LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   back space erases whole term on command line (http://www.linuxquestions.org/questions/linux-newbie-8/back-space-erases-whole-term-on-command-line-721437/)

sharky 04-24-2009 01:14 PM

back space erases whole term on command line
 
Have a problem with backspace on the command line. It backspaces over entire terms instead of single characters

Lets say I enter 'cd /home/$USER/.d5' when I meant to enter 'cd /home/$USER/.dt'. If I hit the backspace button to correct the last character everything is erased except the 'cd'. I have to retype the whole path and keep doing it until it's perfect. If I accidentally hit the backspace more than once it continues erasing whole terms rather than single characters.

Is there a way to turn off this 'feature'?

MensaWater 04-24-2009 03:32 PM

Hit Ctrl-v (hold down ctrl key then hit v). Then hit the backspace key. What you see should be the code the backspace key is sending. (Typically it is ^? or ^H).

Then type "stty -a" and see what "erase=" shows to determine if it matches.

If not then type "stty erase" and hit your backspace key - that should set it to match. You can hit stty -a afterwards to verify it.

Of course this assumes you're not using incorrect TERM value (echo $TERM to se that) or haven't done some odd mapping manually.

sharky 04-24-2009 06:47 PM

Quote:

Originally Posted by jlightner (Post 3519875)
Hit Ctrl-v (hold down ctrl key then hit v). Then hit the backspace key. What you see should be the code the backspace key is sending. (Typically it is ^? or ^H).

Then type "stty -a" and see what "erase=" shows to determine if it matches.

If not then type "stty erase" and hit your backspace key - that should set it to match. You can hit stty -a afterwards to verify it.

Of course this assumes you're not using incorrect TERM value (echo $TERM to se that) or haven't done some odd mapping manually.

Thanks for the response.

Ctrl-v backspace returns ^?

partial return of stty -a:
Quote:

.
intr = ^c; quit = ^\; erase = ^h; kill = ^u;
rprnt = ^r; flush = ^o; werase = ^?; lnext = ^v;
$TERM is set to xterm.


If I enter 'stty erase' and then hit the backspace key it simply erases 'erase' on the command line. No change is affected.

amani 04-24-2009 07:22 PM

Mention distro and shell.
Otherwise things will not be clear.

sharky 04-27-2009 01:28 PM

Quote:

Originally Posted by amani (Post 3520068)
Mention distro and shell.
Otherwise things will not be clear.

Not a distro. It's Solaris. The shell is csh. Just discover that if I invoke tcsh the issues vanish. That might be the easiest workaround.


All times are GMT -5. The time now is 05:31 AM.