[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow key
From: |
Stefan Monnier |
Subject: |
bug#1721: 23.0.60; visual-line-mode under terminal (-nw) makes arrow keys not working |
Date: |
Tue, 30 Dec 2008 21:42:04 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
> I think I have got the idea. It is because visual-line-mode maps "M-["
> to previous-logical-line as in simple.el
> =========
> (defvar visual-line-mode-map
> (let ((map (make-sparse-keymap)))
> (define-key map [remap kill-line] 'kill-visual-line)
> (define-key map [remap move-beginning-of-line] 'beginning-of-visual-line)
> (define-key map [remap move-end-of-line] 'end-of-visual-line)
> (define-key map "\M-[" 'previous-logical-line)
> (define-key map "\M-]" 'next-logical-line)
> map))
> ===========
> But in terminal (-nw), arrow keys are actually "M-[ A" "M-[ B" "M-[ C"
> "M-[ D". Hence letters "A" "B" "C" "D" will be inserted to the buffer.
> To prove my idea, I tried:
> (define-key visual-line-mode-map "\M-[" nil)
> (define-key visual-line-mode-map "\M-]" nil)
> and the issue is solved.
That looks like a problem indeed. This said, since Emacs-23 uses
input-decode-map rather than function-key-map to decode M-[ A into an
arrow key, it should take precedence to the binding in
visual-line-mode-map. Can you check input-decode-map and
function-key-map to make sure that the mapping from escape sequence to
arrow key events is at the right place (i.e. not in function-key-map)?
Also, the terminals to which I have access use difference sequences than
the ones you show (which do ring a bell, tho). Could you give us some
details about the terminal you're using and its configuration?
Stefan