有关如何让emacs在'ansi-term'缓冲区中将未绑定的F1..F12键发送到常规终端的程序的任何提示?
答案 0 :(得分:2)
您正在寻找的不是“解除绑定”,而是将这些键绑定到正确的转义序列。以下将[f1] .. [f5]绑定到术语和ansi-term缓冲区的那些键的vt100转义序列。我不确定ansi的正确序列是什么,所以相应地调整alist。
(defun term-send-function-key ()
(interactive)
(let* ((char last-input-event)
(output (cdr (assoc char term-function-key-alist))))
(term-send-raw-string output)))
(defconst term-function-key-alist '((f1 . "\e[OP")
(f2 . "\e[OQ")
(f3 . "\e[OR")
(f4 . "\e[OS")))
(dolist (spec term-function-key-alist)
(define-key term-raw-map
(read-kbd-macro (format "<%s>" (car spec)))
'term-send-function-key))