This sounds like a problem accessing an Ubuntu 12.04 machine through Putty when END forced Emacs 23.3.1 to say <select> is undefined
. This turned out to be a problem with terminfo , which allows programs to use terminals in a device-independent way.
Based on this discussion of the 2008 bug report, I solved my problem by adding the following to the beginning of my ~ / .bashrc:
NB, either with xterm-vt220 or default xterm, emacs -Q -nw
gets ESC [ 4 ~
when I press END, ESC OA
for Up and ESC [ A
for Shift-Up. (To find out which Emacs code codes are received, press a few buttons and then Ch,l
.) For the same keys, in the same order, cat
says [4~
, [A
and [OA
... so Up and Shift-Up are weird upside down.
If you don't want to change your terminfo, see this discussion for a workaround
http://lists.gnu.org/archive/html/help-gnu-emacs/2011-05/msg00211.htmlYou should be able to get around the problem with something like:
(define-key input-decode-map "\e[1;2A" [S-up])
And in order for this to take effect at the right time, you will need to use something like in your .emacs:
(if (equal "xterm" (tty-type))
(define-key input-decode-map "\e[1;2A" [S-up]))
source share