<<< Date Index >>>     <<< Thread Index >>>

Re: Backspace problems in XTerm



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday, September  6 at 09:54 PM, quoth Kumar Appaiah:
>1. Everything's fine, except that in the pager, if I press backspace,
>it says key not bound. If I press Ctrl+H, it works as expected.

Okay... all that means is that (probably) your backspace key isn't 
emitting a ^H but is instead emitting a ^?. Some terminals do one 
while some do the other. Xterm is convenient in that its easy to tell 
it which one to emit. You can verify this by, in the shell (or 
anywhere else) typing control-V and then pressing the backspace key.

>2. All other applications work fine; emacs -nw, vim etc.

Of course; probably because your stty settings define ^? to be the 
"erase" character. In most cases, this is enough.

>3. So, in Mutt, I wish to bind my previous-line to Ctrl+H in the
>pager. However, when I add bind \008 to previous-line, it still
>doesn't work. When doing a "?", the binding displays as "^H" all
>right, but below, it says <BackSpace> again, and my binding has no
>effect.

This config line:

     bind pager \008 previous-line

Binds the key sequence backslash-zero-zero-eight to previous-line. It 
does not bind the key hexadecimal-eight to previous-line.

When you bind things, though, mutt ignores the terminal settings and 
does exactly what you tell it to. In other words:

     bind pager ^H previous-line

Will only bind ^H and not whatever your backspace key happens to be 
emitting. If your backspace key is emitting ^?, then it's pretty 
obvious why this command does not bind previous-line to the backspace 
key.

Irritatingly, while the following *should* make mutt use whatever 
character is currently the "erase" character, it doesn't. Sadly, it's 
equivalent to the previous example:

     bind pager <BackSpace> previous-line # this syntax should work

>Can you suggest an effective workaround? Using XTerm's "Backarrow Key"
>fixes this, but it breaks all other apps, like emacs -nw, break.

The obvious workaround is to bind whatever your backspace key IS 
emitting. E.g. this:

     bind pager ^? previous-line

(note that you have to enter that in your muttrc by making sure the ^? 
is not the two-letter sequence carrot-questionmark, but is the 
single-character sequence that your delete key is emitting.)

~Kyle
- -- 
A wise man changes his mind, a fool never.
                                                     -- Spanish proverb
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFG4DQEBkIOoMqOI14RAmA4AJ9ZURMKlPQ7mWiV41IaeCe3dbO2WACbBuhc
eaTHLH+AVt9F7PJiCq37TpU=
=Mz9u
-----END PGP SIGNATURE-----