Making backspace be your default delete character

One consistently-annoying thing about Solaris is the default terminal control-character settings, which cause Backspace \*not\* to erase a character in most shells (without someone somewhere executing an "stty erase \^H" to fix it up). I'm not going to claim that the default is rational, or try to speculate about where it arises, although I will say that it's being looked at.

However, today, we discovered that it's relatively easy to change; the initial control-character settings are set up by the ldterm module (the "line-discipline" is the one that establishes all the normal character-editing modes that many shells use when using "cooked-mode" terminal I/O). ldterm, it turns out, reads them from a property in the /kernel/drv/options.conf file, called ttymodes. It's encoded, but it represents the full termio settings, as stty -g would output them. The default looks like this:

ttymodes="2502:1805:bd:8a3b:3:1c:7f:15:4:0:0:0:11:13:1a:19:12:f:17:16";

If you change that 7f (the ASCII code for Del) to 8 (the ASCII code for Backspace), and reboot, then Backspace works as you expect, as soon as you log in, in all shells, thank you very much, the way God intended.

Comments:

This is just great! I'm off to put this into my Solaris build pronto!!!

Posted by UX-admin on October 20, 2006 at 06:47 PM PDT #

What's so bad about occasionally typing "stty erase \^H intr \^C"? I type that in my sleep. At most customer sites I have to exec my favorite shell over that korn shell pig anyway... :-)

Posted by Volker A. Brandt on October 21, 2006 at 01:33 AM PDT #

Oh man. Solaris is sooooo user-unfriendly and you just made my life as a solaris-newb so much easier! Thanks! That ought to be tip of the year.

Posted by boniek on October 21, 2006 at 12:41 PM PDT #

[Trackback] There are several fixes for “\^H\^H\^H\^H” on Solaris, but Dan Mick has found a fix that I had not seen before. You can simply replace 7f with 8 in the ttymodes property located in /kernel/drv/options.conf. I have not tested this fix. Two oth...

Posted by engrowe.com on October 22, 2006 at 10:40 AM PDT #

Post a Comment:
Comments are closed for this entry.
About

user12614486

Search

Categories
Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today