problem with backspace key in xterm-256color
I'm running mutt in xfce4-terminal, which supports 256 colors, but I have to manually set xfce4-terminal in its preferences dialogue to identify as xterm-256color for mutt to display my 256-color colors. So far, so good. Now I've noticed that with TERM=xterm-256color, mutt doesn't recognize the backspace key in the index or the pager (I have bindings for backspace in the .muttrc, but it says key not bound). When I set TERM to xterm, the backspace key works fine. In the Advanced tab of my xfce4-terminal settings, I have a setting for backspace key generates ... with the options - Auto-detect - ASCII DEL - Escape Sequence - Control-H Only if I set this to Control-H does mutt recognize the backspace key while TERM is set to xterm-256color. However, in that case, my editor (jed) doesn't recognize the backspace anymore as such, and given that that means I'll have trouble with other applications I'd rather go back to Auto-detect for the terminal config. Does anyone know a way -- either to tell mutt to listen for whatever the backspace key generates when I have TERM=xterm-256color? How would I find out what the terminal emits when the backspace key is pressed? -- or to tell the xfce4-terminal to go back to the same behavior it has with TERM=xterm, which is to do the right thing and presumably emit Ctrl-H for the backspace key when in mutt? Googling, I just found this long thread: http://bugs.mutt.org/trac/ticket/2952 but if there were practical solutions therein I failed to grasp them. Thanks, m.
Re: problem with backspace key in xterm-256color
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sunday, June 15 at 05:11 PM, quoth Marianne Promberger: I'm running mutt in xfce4-terminal, which supports 256 colors, but I have to manually set xfce4-terminal in its preferences dialogue to identify as xterm-256color for mutt to display my 256-color colors. So far, so good. Hrmf. The XFCE folks *really* ought to provide their own termcap file. Telling your applications to pretend that it's a different terminal (e.g. an xterm) is practically guaranteed to get you incorrect behavior in some respect. Now I've noticed that with TERM=xterm-256color, mutt doesn't recognize the backspace key in the index or the pager (I have bindings for backspace in the .muttrc, but it says key not bound). When I set TERM to xterm, the backspace key works fine. Interesting... does the terminal actually alter what it emits? In other words, when you press control-V backspace, what shows up in your shell, and does what shows up change based on the TERM setting? If not, is your termcap perhaps different? Try these two commands: infocmp -1 -L xterm | grep key_backspace infocmp -1 -L xterm-256color | grep key_backspace They *should* be the same, but if they're not on your system, that would explain your problem (both should print out key_backspace=^H,). In the Advanced tab of my xfce4-terminal settings, I have a setting for backspace key generates ... with the options - Auto-detect - ASCII DEL - Escape Sequence - Control-H Uy. I wonder what auto-detect is actually doing. Only if I set this to Control-H does mutt recognize the backspace key while TERM is set to xterm-256color. Which suggests that the auto-detection isn't actually working very well. However, in that case, my editor (jed) doesn't recognize the backspace anymore as such, That suggests that jed is using different terminal libraries than mutt. I bet you can get them to agree on the backspace character by simply ensuring that both of them use the same terminal libraries. If memory serves, jed requires slang---since mutt can be compiled with slang (the default is ncurses), try that. Googling, I just found this long thread: http://bugs.mutt.org/trac/ticket/2952 but if there were practical solutions therein I failed to grasp them. Just as there are several different bits and bobs of software that have to agree on these conventions (such as which byte is emitted for a backspace), there are several different ways to solve a problem when they disagree. ~Kyle - -- Computers are useless. They can only give you answers. -- Pablo Picasso -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iEYEARECAAYFAkhVj8YACgkQBkIOoMqOI17gPACfcfHq+baKh2wI7uQ22LsNFufC 2Y0An0qi+8cQjKOSoXxOz31NJUI9wfam =EMRO -END PGP SIGNATURE-
Re: problem with backspace key in xterm-256color
Thanks Kyle! That helped my solve the problem by using \177 instead of backspace in the .muttrc Here is the info ... On 06/15/08 16:55, Kyle Wheeler wrote: On Sunday, June 15 at 05:11 PM, quoth Marianne Promberger: Now I've noticed that with TERM=xterm-256color, mutt doesn't recognize the backspace key in the index or the pager (I have bindings for backspace in the .muttrc, but it says key not bound). When I set TERM to xterm, the backspace key works fine. Interesting... does the terminal actually alter what it emits? In other words, when you press control-V backspace, what shows up in your shell, and does what shows up change based on the TERM setting? both with TERM=xterm and TERM=xterm-256color, pressing Ctrl-v backspace shows up as: ^? Whatever that means. However ... If not, is your termcap perhaps different? Try these two commands: infocmp -1 -L xterm | grep key_backspace key_backspace=\177, infocmp -1 -L xterm-256color | grep key_backspace key_backspace=^H, They *should* be the same, but if they're not on your system, that would explain your problem (both should print out key_backspace=^H,). Okay, so I solved my problem very pragmatically by just putting bind index \177 instead of bind index backspace, and it works. That is good enough for me, as I'm lazy and I'd rather not recompile mutt with slang :) But it occurred to me that another way to solve this would be if mutt skipped checking for my terminal's color support. I mean, whether I have TERM set to xterm or xterm-256color doesn't actually change the colors it supports, as far as I can tell, since I can use lots of colors from a palette for e.g. the way folders are distinguished from files etc. Or does it? If mutt could skip checking for TERM=xterm-256color, that would make my life easier anyway, since with that TERM some remote shells refuse to operate, because they say I know nothing about your terminal (I've worked around that problem by setting practically all my ssh .bashrc aliases to start with export TERM=xterm ssh ... . Yes, one dirty workaround after another, I know ... :) m.
Re: problem with backspace key in xterm-256color
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Sunday, June 15 at 06:16 PM, quoth Marianne Promberger: That helped my solve the problem by using \177 instead of backspace in the .muttrc Heh, sure, that's one way to do it. both with TERM=xterm and TERM=xterm-256color, pressing Ctrl-v backspace shows up as: ^? Okay... (that's the same as \177) If not, is your termcap perhaps different? Try these two commands: infocmp -1 -L xterm | grep key_backspace key_backspace=\177, infocmp -1 -L xterm-256color | grep key_backspace key_backspace=^H, HUH! Interesting. You have a broken xterm termcap file. Where did it come from? That is good enough for me, as I'm lazy and I'd rather not recompile mutt with slang :) As long as it works for you, that's the important thing. But it occurred to me that another way to solve this would be if mutt skipped checking for my terminal's color support. Can't. That's part of the ncurses library. Essentially, there is no standard way of saying I want to draw this letter in color 157, so it *has* to look up how to say that. The act of looking it up is what tells it how many colors the terminal supports. If mutt could skip checking for TERM=xterm-256color, that would make my life easier anyway, since with that TERM some remote shells refuse to operate, because they say I know nothing about your terminal (I've worked around that problem by setting practically all my ssh .bashrc aliases to start with export TERM=xterm ssh ... . My solution was to copy an nsterm-16color termcap file (that's what terminal I use) to all those remote servers. :) That way I can tell myself it's not a workaround, it's the correct way of providing information about my terminal. ~Kyle - -- For every complex problem, there is a solution that is simple, neat, and wrong. -- H. L. Mencken -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iEYEARECAAYFAkhVmEEACgkQBkIOoMqOI14BMACg+q+K0uS5HvSCZvAz+9xUv74Y TvcAnjFJLKOEBDX4Kutaip1t/7Nr9aCE =59bb -END PGP SIGNATURE-
Re: problem with backspace key in xterm-256color
On 06/15/08 17:31, Kyle Wheeler wrote: On Sunday, June 15 at 06:16 PM, quoth Marianne Promberger: both with TERM=xterm and TERM=xterm-256color, pressing Ctrl-v backspace shows up as: ^? Okay... (that's the same as \177) If not, is your termcap perhaps different? Try these two commands: infocmp -1 -L xterm | grep key_backspace key_backspace=\177, infocmp -1 -L xterm-256color | grep key_backspace key_backspace=^H, HUH! Interesting. You have a broken xterm termcap file. Where did it come from? I have NO idea. :) I'm not going to figure this out now, works good enough for me. Thanks again for your help, and the comprehensive info! m.
Re: Backspace key
Quoting Adam Gray ([EMAIL PROTECTED]): The backspace key does not seem to be working anywhere in mutt. Besides all the useful comments from the others on this list, i had the same problem some time ago. I don't recall exactly how i fixed it, but it had to do with the TERM= environment variable as well. Especially the combination xterm ssh screen would break, but now it has been ok for ages for me. -Sndr. -- | I wish i was a glow worm, a glow worm's never glum. | How can you be unhappy when the sun shines out your bum! | 1024D/08CEC94D - 34B3 3314 B146 E13C 70C8 9BDB D463 7E41 08CE C94D
Re: Backspace key
On Fri, Jun 08, 2007 at 03:54:36PM +0200, Sander Smeenk wrote: Besides all the useful comments from the others on this list, i had the same problem some time ago. I don't recall exactly how i fixed it, but it had to do with the TERM= environment variable as well. Well that seems to be true in my case as well. Mutt doesn't seem to like having $TERM set to any of the xterm ones. Setting it to 'linux' works fine though. So what would be the best way to set this as default for xterm? And would this be likely to break other stuff? A -- Adam Gray [EMAIL PROTECTED] Can't act. Slightly bald. Also dances. -- RKO executive, reacting to Fred Astaire's screen test. Cerf/Navasky, The Experts Speak
Re: Backspace key
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, June 7 at 06:33 PM, quoth Adam Gray: The backspace key does not seem to be working anywhere in mutt. This is particularly annoying (as you can probably imagine) in places like the compose address and search fields. However, the key works fine in Vim and in xterm. It also works fine when I'm not using X, which suggests it's an X thing. There is, however, a similar problem in aptitude (using Debian here). Any help would be appreciated. I suspect this is because you are using the wrong keymap. I'm rather surprised it works in vim, but I know bash jumps through a lot of ugly hoops to behave reasonably under such conditions. I don't know how to fix such a thing permanently (it usually happens for me when I'm logged into a system remotely), but the temporary fix is to explicitly define what backspace should be, using the `stty` command. What you need to do is type in: stty erase ... with an extra space at the en (after the word 'erase') and then press control-v and then press the backspace key. That will put up whatever control-character your backspace key is emitting (it'll probably look either like this: ^? or like this: ^H ). The command line will end up looking kinda like this: stty erase ^? Don't just type in a carot (^) and a question mark (?) though, because that's not the same thing. Anyway, hit enter, and presto: your backspace key will work as expected in all programs running in that particular terminal. ~Kyle - -- I'm sick of following my dreams. I'm just going to ask them where they're going and hook up with them later. -- Mitch Hedberg -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iD8DBQFGaEsSBkIOoMqOI14RAiL9AJ9reMEOC6zlT3wPTDxoopAMdvaCbwCgmEBf eYSw7e9FCbfaRhE3Rk3mJXU= =Pepm -END PGP SIGNATURE-
Re: Backspace key
Thanks for replying. On Thu, Jun 07, 2007 at 12:14:42PM -0600, Kyle Wheeler wrote: I suspect this is because you are using the wrong keymap. I'm rather surprised it works in vim, but I know bash jumps through a lot of ugly hoops to behave reasonably under such conditions. I don't know how to fix such a thing permanently (it usually happens for me when I'm logged into a system remotely), but the temporary fix is to explicitly define what backspace should be, using the `stty` command. What you need to do is type in: stty erase ... with an extra space at the en (after the word 'erase') and then press control-v and then press the backspace key. That will put up whatever control-character your backspace key is emitting (it'll probably look either like this: ^? or like this: ^H ). The command line will end up looking kinda like this: stty erase ^? Don't just type in a carot (^) and a question mark (?) though, because that's not the same thing. Anyway, hit enter, and presto: your backspace key will work as expected in all programs running in that particular terminal. Ok firstly I just noticed that actually the backspace key is working, but it's doing the function of the delete key (i.e. delete the next character). Weirdly enough, doing ^H in mutt does work as a backspace. Doing `stty erase ^?` (i.e. backspace) doesn't do anything, and if I do `stty erase ^H` then the backspace works in xterm, but doesn't work in vim and still doesn't work in mutt. Confusing, eh? o_O A -- Adam Gray [EMAIL PROTECTED] No Canadian coins.
Re: Backspace key
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, June 7 at 07:47 PM, quoth Adam Gray: Ok firstly I just noticed that actually the backspace key is working, but it's doing the function of the delete key (i.e. delete the next character). Yup, that's what usually happens. Weirdly enough, doing ^H in mutt does work as a backspace. Doing `stty erase ^?` (i.e. backspace) doesn't do anything, and if I do `stty erase ^H` then the backspace works in xterm, but doesn't work in vim and still doesn't work in mutt. Confusing, eh? o_O Hmm... just sounds like you've got some weirdness to straighten out. Show me the output of this command: stty -a ~Kyle - -- 'We hold these truths to be self-evident,' they said, 'that all men are created equal.' Strange as it may seem, that was the first time in history that anyone had ever bothered to write that down. Decisions are made by those who show up. -- Jed Bartlet, The West Wing -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iD8DBQFGaG+kBkIOoMqOI14RAg8EAKDEHPNwXH3ifT5nDRRjLOtfhvguJACgw0CK TeBlJ3bDYdDMIRM2cTmFth8= =uyBG -END PGP SIGNATURE-
Mutt and xvt: problems with backspace key
Hello, Odd question here that may be something related to Mutt, but seems more related to my xvt terminals. Recently I switched from using xterms to using xvt terminals. When I made this switch, something bizarre happened. When filling in the lines for To: and Subject:, I can no longer hit backspace to go back and correct a mistake. This only happens in this part of the composition process. Working on the body of the message is completely normal. Does anyone know if this is fixable? Thanks, Bryan Walton