In the old days, men were real men, women were real women, small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri, and Anglo-Saxon programmers thought that 95 printable characters and 33 control characters was enough for everybody. Bytes were pretty much 8-bit large all around, but 7 bits were enough for all the characters, so each byte meant to represent a character had a spare bit. Many terminal makers decided to put that spare bit to good use. Terminals often had a modifier key to indicate “I want to invoke a command” as opposed to “I want to type a character”, called Meta. So many terminals used that spare bit to indicate “the Meta key is down”. For example, pressing . sends the byte value 46 (ASCII code of the character
.); pressing Meta+. sends the byte value 46+128 = 174.
Then people using European languages wanted to use computers, too. They needed to be able to write in other alphabets, and characters with diacritics, and English and non-English speakers alike wanted to have more punctuation characters. so they designed a number of character encodings that extended ASCII to make use of that 8th bit. For example, in the ISO 8859-1 encoding (a.k.a. Latin-1), the byte value 174 encodes the character
®. On terminals where the Meta key is encoded as setting the 8th bit of the byte value, when running an application that expects input encoded in ISO 8859-1, pressing Meta+. effectively sends the character
Some Europeans started memorizing that Meta+. would insert
®, and that Meta+i would insert Meta+é, and so on. But this didn't help people who didn't want to memorize. Fortunately, there were other solutions, such as national keyboard variants (where the French get a é key, and the Swedes get a å key, and so on), dead keys and compose keys. In any case that solution wouldn't work for the people who wanted more than 256 different characters, such as speakers of most Asian languages.
Meanwhile, another, more common convention to encode the Meta key evolved: have it send the Escape character before the encoding of the key. For example, Meta+. would send the same two-byte sequence as Esc, .. This is what most applications expect nowadays.
Having the Meta key set the 8th bit is a long-obsolete technological decision, but it still lives on in the default configuration of some systems. PC keyboards don't have a key labeled Meta, but they have a key labeled Alt in the same location and with the same expected effect, so wherever you read about a “Meta” key, that applies to “Alt”.
Xterm defaults to having Meta set the 8th bit, for historical reasons. To make it send an Escape character instead, you need to either:
- set the
metaSendsEscape resource to
true (there's also
altSendsEscape, but it only applies if you've set the
altIsNotMeta resource to
true, which is only useful if you have both Alt and Meta keys on your keyboard); or
- set the
eightBitInput resource to
false (despite the name, this does not prevent non-ASCII input, this only determines what Meta+character sends).
Put either of the following lines in the file
xrdb -merge ~/.Xresources to reload this file. Most environments arrange to run this command when you start the GUI; if yours doesn't, add it to your GUI login scripts.
You can also toggle the
metaSendsEscape resource in the Ctrl+Left-Click menu (“Meta Sends Escape”). This only affects the xterm instance where you use it.
Your other Links keyboard shortcut problems are related to Links, not to the terminal.