I have set up zsh to use emacs mode. But typing Alt+f or Alt+b inserts weird symbols (accented letters and so on), rather than moving around by word in the shell like it should. Since I don't ever want to insert the "ae" symbol into a shell prompt, how can I get zsh to behave?

I had the same problem with bash, but now that I'm actually taking the time to customise zsh, I thought I'd ask...

AltGr+b etc. produces different weird symbols...

I'm using Ubuntu 10.4

  • Are you using gnome-terminal? – Paused until further notice. Sep 3 '10 at 17:54
  • xterm, I believe. Is that the same thing? – Seamus Sep 3 '10 at 18:11
  • no xterm is a program (which practically ships as part of xorg), so is gnome-terminal. gnome-terminal is an X Terminal however, and that's often abbreviated as xterm. Just to clarify any confusion – xenoterracide Sep 3 '10 at 18:34

It's not zsh that's misbehaving, it's xterm. The reason it's misbehaving is an obsolete setting that causes xterm to send character number x+128 when you press Alt together with character number x. The normal behavior in a text terminal is to have Alt+a send ESC a.

To tell xterm to leave 8-bit characters alone, turn off the XTerm.VT100.eightBitInput resource (despite the name, it doesn't affect what happens when you enter an 8-bit character). You'd normally do this by adding the following line to ~/.Xresources:

XTerm.VT100.eightBitInput:      false

~/.Xresources is read when you log in in most unix distributions. To read it immediately, run the command

xrdb -merge ~/.Xresources
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.