On Tue, May 14, 2002 at 10:23:38AM +0200, Wojciech Krygier wrote: > Just in case it might be helpful: "bind editor \ch backward-char" works > fine here, even without unbinding its previous action, so it seems that > it isn't mutt fault. I would check the terminal definitions instead. Try > console first.
That's very helpful, I think. At least we know it's possible, under some set of cirumstances. My /etc/ttytype file lists "linux" for the six consoles, and "vt100" for all the xterms I really use most of the time (really kvt on a KDE 1.xx desktop). And voila! it seems that \ch does backward-char by default on the linux console. Maybe in a linux console, Mutt uses readline in the editor. Looking further, the current Terminal Options for the KDE "kvt" has <backspace> sending Delete (^?); if I switch it to (^H), the readline \ch backward-char still works, but now the <backspace> key also does backward-char. Mutt still does backspace by default for \ch, and rebinding \ch to backward-char still produces backspace, not backward-char. So apparently for "vt100" with whatever is in my terminfo definition file, Mutt is adamant about performing backspace for the \ch key. The default TERM in this kvt is "xterm-color." If I export TERM=xterm Mutt does backward-char by default---no rebinding neccessary---for \ch. Of course, I lose lots of other functions that I care about, so I'll stick with the default TERM. All interesting evidence, but I'm not trying to reverse-engineer Mutt---I could just dive into the source for that! :) It would seem that the \ch key combination is treated differently by Mutt from other control keys, and apparently rebinding it is not a trivial matter. I'll probably take the time to dig into the source eventually, but life is only so long... In the meantime, I can live with the anatomically-awkward \cb. If someone who knows Mutt's internals cares to explain how Mutt gets its idea of \ch that'd be great, but I suspect it's not a very interesting question for the cognoscenti (too easy, or too hard), or one of them would have spoken up by now. Jim