8

Something weird sometimes happens on my Debian system. Typically at the prompt line I can use combo like alt-d to delete a word, alt-f to go to the next word, etc.

But quite regularly something happens in my xterm that makes alt-d and alt-f not work anymore: suddenly they print 'ä' (alt-d) and 'æ' (alt-f).

Note that this happens in a terminal that was acting like I wanted to at first. But then somehow must send a code or something that changes the behavior of the terminal.

It happens in xterm because that's where I always work. If I go to a console by doing ctrl+alt+f1 then by default alt-d does what I want (delete word) and so does alt-f. Maybe that I could screw that one too by doing some bad manipulation: I just don't know because I don't work in text mode.

Also note that if I spawn an xterm from the "broken" xterm, then the new xterm work as I expect.

What is going on? What am I turning on that was off previously?

My .Xresources says that and, once again, when I open an xterm it behaves as I expect it, it's only later on that "something" makes that it goes back to broken "I-print-characters-with-diacritics-and-other-nonsense" mode:

$ more .Xresources 
XTerm.vt100.eightBitInput: false
XTerm*eightBitInput: False

3 Answers 3

11

you need

xterm*metaSendsEscape:  true

in your ~/.Xdefaults

xrdb ~/.Xdefaults

Start a new xterm, hopefully that shouldn't have the problem anymore

3
  • @freethinkey: when I start a new xterm there's never any issue: but it drives me crazy when my current xterm does it. But how comes at first it works, then someone the xterm interprets a meta as not an escape anymore even though 5 seconds before that same xterm interpreted it as an escape? (+1 btw)
    – Weezy
    May 18, 2011 at 19:35
  • well not sure whats resetting the settings, you can do a ctrl+leftclick and see if "Meta Sends Escape" is ticked or not, if it happens again May 19, 2011 at 1:51
  • 2
    Worked for me. xterm now black on white instead of white in black as it was before.
    – SabreWolfy
    Oct 14, 2012 at 22:36
1

add this:

% grep -i escape .Xdefaults 
     xterm*metaSendsEscape: true

(so, tell xterm that your alt key is sending escape)

4
  • +1 too, same comment as for freethinker: how comes at first it works, then someone the xterm interprets a meta as not an escape anymore even though 5 seconds before that same xterm interpreted it as an escape?
    – Weezy
    May 18, 2011 at 19:36
  • well, you can change things on-the-fly, may that be by accident or whatever: if alt stops working, check your xterm by pressing strg leftmouse and see if the option is ticked (just like @freethinker said). then investigate, if yout pressed some keys before the change happened
    – akira
    May 19, 2011 at 5:55
  • 2
    german are we? strg? Surely that must be ctrl!? :)
    – Weezy
    May 19, 2011 at 15:22
  • well, brainiac, it states 'germany' at my profile quite clearly, so ... trivial to spot, even without whats printed on the keyboard.
    – akira
    May 19, 2011 at 16:17
0

I have the same problem here. Everything works fine on my local xterm on Debian. However, if I ssh into a RHEL server, m-b/m-f doesn't work. They still don't work even after I logged out from RHEL.

I digged the source code and find a hack, just add the following lines in your ~/.Xresources:

XTerm*VT100*Translations: #override \n\
     Meta <KeyPress>:insert-seven-bit()

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .