I identified the cause of this bug. It happens when PS1 environment variable contains certain \e escape code like '\[\e[01;32m\][\h:\w]\$\[\e[00m\] '. In such a case, term.el gets messed up somehow and becomes no longer able to handle meta (alt) keyboard input properly. On Sun, Jan 17, 2010 at 6:09 AM, Ken Hori wrote: > It happens on Linux as well > (For example, Emacs 23.1.91 bzr revision 99310) > > So M-d (delete-next-word) on term-mode does not work, even though term-mode > is supposed to be emulating a terminal as it is. > > I can confirm this bug has existed for at least 1 month. > Perhaps reporting it again with a more noticeable title might get more > attention that it deserves. This is a major bug that keeps me from using M-x > term. > > On Wed, Jan 6, 2010 at 3:35 PM, Scott Bell wrote: > >> Under Mac OS X 10.6.2, Emacs 23.1.90.1, in an M-x term buffer >> running /bin/bash, I get the following undesired behavior in >> Cocoa emacs (Emacs.app/Contents/MacOS/Emacs -q) when typing >> `one two M-DEL' where meta is typed as the alt/option key: >> >> $ one two˙ >> >> This occurs even when ns-alternate-modifier is set to 'meta. >> Running Emacs in a terminal window (Emacs.app/Contents/MacOS/ >> Emacs -q -nw) works as I expect: >> >> $ one >> >> >> >> >> >