So the first distro disk booted, and we got a RH screen up. Now someone at RH had done some thinking about what a user might be thinking if they put the distro disk in a machine without a harddrive, so the script had actually sidetracked us into the "verify the installation" tool, which was interesting. We decided, what the hey, and did the verify, which confirmed that yes this was a functional cdrom. At that point we backtracked in the menus, powered up the hard drive, and proceeded on our merry way doing the install. There was some question as to whether this would work, since as we had just blown away the BIOS settings, the BIOS didn't even have a record of the hard drive, but not to fear, it all worked just fine.
After playing around with the custom install settings, doing my own weird partition setup, and diddling install packages; we sent it on its way and it proceeded to install everything for the most part. (I thought I told it to install FTP, but we haven't seen any signs of it yet.) It finished, did its little reboot, and we were left with a brand new RH 9 install. Tada.
So I logged in from my PC where I do all my real work (not that I do real work on windows, but my best screen, a Sony W900, is hooked up to a windows 2000 machine, where I run the hummingbird extreme X server), and I fired up some xterm's after changing the default background color so I could tell the windows for grub apart from handspring. They came up just fine, but backspace wasn't working. It would blap, *beep*[3~ at me, and put more crud on the command line instead of covering up my typographical slip-ups.
Obviously, the problem was X11R6, since RH 7.3 was working just fine. Great, somebody decided they needed to *fix* something, and now I can't backspace, except by typing ctrl-h (which I can do, it's just more work). Do some quick checks on my xserver kbdmap, and also check xmodmap but everything seems fine there. Off to the web to waste my afternoon figuring this out.
The first page I found, didn't actually exist anymore, but the snippet on google looked so promising that I pried it out of its cache. The first thing I found is that because of the ultimate evil in the universe (emacs) wanted to use ctrl-h for help, they got everyone else to change what was a perfectly good coding standard. Ok, so now backspace is supposed to map to 0177 (which was delete), and delete is supposed to map to 'ESC [ 3 ~'. Well, I'm getting the escape sequence just fine, so clearly xterm has already been corrupted. I'm not seeing a 0177 or a BS, so something is still messed up. The article goes on to suggest a bunch of xterm keybinding settings, like:
but like I said. I was already seeing that goofy sequence, so the problem was further down.! Fix xterm's keybindings *VT100*translations: #override
BackSpace: string(0x7F) \n Insert: string(0x1b) string("[2~")\n Delete: string(0x1b) string("[3~")\n Home: string(0x1b) string("[1~")\n End: string(0x1b) string("[4~")\n Page_Up: string(0x1b) string("[5~")\n Page_Down: string(0x1b) string("[6~")
Switched over into digging into my code to check the routines that normally convert keysyms to ascii. The routine in question is XLookupString(), and you can sample both the raw event and the translated result with xev, so I tried that next. They were doing the right thing, getting BackSpace and Delete keysyms and translating BackSpace into a single character; so the problem was further down.
The next suspect was terminfo, but unfortunately the files in /usr/share/terminfo are no longer human readable, so that wasn't a lot of help. Back to google with some new keywords, and end up here: Consistent BackSpace and Delete Configuration. Sounds promising.
First neat trick, checking the terminfo data with infocmp. Turns out kbs=^H and kdch1=\177 which is what I would have expected before learning about the GNU corruption. Check what it was on my working system: kbs=\177, kdch1=\E[3~ Aha. So now I have three choices on fixing things: 1) unwarp the keyboard bindings, which would then break handspring; 2) hack the terminfo block, or 3) try and deal with the shell mapping layer.
Now the original paper had info on hacking bash through /etc/inputrc, but I don't use bash. I am a died in the wool csh user (though I have migrated to tcsh for a few modern conveniences, like command completion), but luckily the second document included the same instructions for tcsh. Basically there is a shell builtin bindkey which you can use to both dump out the current configuration and make changes. Its recommendations were:
which would have been ok, except delete-char isdeprecated. Ok, search the existing list of 120+ lines for delete: its now called backward-delete-char, obviously so you don't confuse it with forward-delete-char, I guess. Hmmm, but there's no forward-delete-char in the list. Ah, it must be the new delete-char-or-list-or-eof. Is this making sense to anybody else? Never mind, fix delete and end (which was also messed up, but for some reason home wasn't). Now I can get back to my regularly scheduled attempt at getting paying work done.bindkey "\e[1~" beginning-of-line # Home bindkey "\e[7~" beginning-of-line # Home rxvt bindkey "\e[2~" overwrite-mode # Ins bindkey "\e[3~" delete-char # Delete bindkey "\e[4~" end-of-line # End bindkey "\e[8~" end-of-line # End rxvt