Project

General

Profile

Bug #301

Backspace key prints ^H to console instead of deleting a character

Added by andrew k7 about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2010-10-05
Due date:
% Done:

0%

Estimated time:
Difficulty:
Tags:

Description

Pressing the backspace key on a standard keyboard on Solaris (and therefore Illumos) does not produce the expected behaviour - i.e. the deletion of the character immediately to the left of the current cursor position. Instead the text '^H' is echoed to the screen. Once logged in this can be fixed by issuing the command 'stty erase ^H' but this still leaves two problems: 1) the delete key will then do nothing and 2) this does not help fix the problem of backspace producing a ^H before you log in.

The problem does not usually happen when you are running inside X windows - it is most evident when running with a text console.

When I raised this issue a few years ago on opensolaris.org I was helpfully informed that this was not a bug, since the system was doing what it was designed to do. I maintain that it IS a bug since the system is not doing what users coming from other systems like Linux expect it to do.

History

#1

Updated by Gary Mills about 9 years ago

This tty setting seems to be the Solaris default:

intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;

The settings for interrupt and backspace actions are a personal
preference. As far as I know, there is no standard and certainly
no consensus. About the best we can do is to make it easy for
each user to set them according to their preference. We do this
in .profile using `tset' to set the terminal type at the same time.
Mine wind up like this:

intr = ^?; quit = ^\; erase = ^h; kill = ^u;

I know that most people expect the interrupt character to be
^C, but I like it to be [Del].

#2

Updated by andrew k7 about 9 years ago

Gary Mills wrote:

The settings for interrupt and backspace actions are a personal
preference. As far as I know, there is no standard and certainly
no consensus.

True, but which other OS has the backspace key not acting as a backspace key by default? My point is that the behaviour is unexpected to users coming from other systems, and for someone like me who has been using OpenSolaris for a few years I still find it a pain in the backside.

#3

Updated by Jason King about 9 years ago

I think this is more of a distribution issue.

Any distro can ship a modified /kernel/drv/options.conf that defines a different default value for ttymodes (which could do things such as define erase as control-h) -- this has the nice effect of being independent of any particular shell (unless of course they override the value).

#4

Updated by andrew k7 about 9 years ago

The fix is to change the following line in /kernel/drv/options.conf:

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

so that it reads:

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

i.e. replace 7f with 8. This makes backspace be the erase key and makes the delete key echo ^? to the screen instead.

A quick google reveals this little piece of information at http://www.unixguide.net/ibm/ibmcribsheet.shtml:

stty erase ^?     Set backspace key for vt100 terminals
stty erase ^H     Set backspace key for wyse50 terminals

So it seems that there is more to this behaviour than I first thought. Since this is dependent on the type of terminal you are using to access the system on I think this is not something Illumos should change since it will actually make things worse for some users (i.e. those using vt100 and presumably some other term types).

Feel free to close this as "not a bug".

#5

Updated by Garrett D'Amore about 9 years ago

  • Status changed from New to Closed

As indicated already, this isn't a bug. In fact, the choice of how this is to be mapped is a combination of both the terminal emulator and the stty setting.

I'm closing this now.

Also available in: Atom PDF