I am working in bash shell on a Solaris environment and whenever I type "backspace" it clears out the entire line.

Do you have any suggestions for me to change the backspace clearing entire line to just a character which is the expected behavior of it?

Hhow do I interpret the output of stty -a command in my local cygwin environment:

$ stty -a <br/>
speed 38400 baud; rows 34; columns 125; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = ^Z; 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

From the wording of your question, I'm assuming that you're using cygwin to access a Solaris machine.

stty -a displays all the current settings for the terminal. I won't go through each one. But you can read up on what each one does on the man pages.

But of particular note to your problem is erase = ^?;. ^? is the ASCII Control Character for DEL (delete). What you want is the control character for BS (backspace).

From the command line you can type the following:

stty erase ^H

But note that the ^H is a control character and not ^H. So I believe the way that you would type this is as follows:


And that should result in ^H being printed to the screen.

That should change the behavior of backspace to what you want. But it would only last for the current session.

According to this Oracle blog, you can permanently change the configuration by opening /kernel/drv/options.conf and looking for the following line:


Change the 7f to 8 to permanently remap backspace from DEL to BS. This will require a reboot to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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