How do I set the ‘backspace’ key in a Solaris serial session?

Okay, so sometimes I’m “Your Solaris Guy” as well as Your Linux Guy.

Either way, I can sometimes be “your forgetful guy”.  So, this post is pretty much a note to myself about one of those settings/commands I cannot seem to remember.

The funny thing about that notion is that whenever I write a blog post about things that I cannot seem to remember, I tend to end up remembering them better from then on, likely due to the mental reinforcement of going through the posting process itself…  Whatever works, I guess…

Anyway, back to the point.

If you happen to be working with a Sparc box, maybe with Solaris (any recent version), and you happen to be connecting with a serial cable (instead of standard monitor/keyboard), and in a terminal shell, then you will likely eventually want to backspace over something. Of course, the backspace key from your Intel box won’t be properly mapped to the instructions in the shell to which you are connected, so you’ll get a bunch of garbage when you hit ‘backspace’, and you can’t do anything but hit ‘enter’ to clear the terminal.  At best, it’s annoying.  At worst, it might cause you to enter something that might not be a good thing…

So to fix that, you will have to enter the following:

stty erase '^H'

…those are single-quotes around the caret-H…

…and now actually typing ‘backspace’ on your keyboard will cause a ‘backspace’ to occur in the shell.

Magic!

😉

Leave a Comment

Your email address will not be published. Required fields are marked *