Function: term-send-function-key

term-send-function-key is an interactive and byte-compiled function defined in term.el.gz.

Signature

(term-send-function-key)

Documentation

If bound to a function key, this will send that key to the underlying shell.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term-send-function-key ()
  "If bound to a function key, this will send that key to the underlying shell."
  (interactive)
  (let ((key (this-command-keys-vector)))
    (when (and (= (length key) 1)
               (symbolp (elt key 0)))
      (let ((name (symbol-name (elt key 0))))
        (when (string-match "\\`f\\([0-9]+\\)\\'" name)
          (let* ((num (string-to-number (match-string 1 name)))
                 (ansi
                  (cond
                   ((<= num 5) (+ num 10))
                   ((<= num 10) (+ num 11))
                   ((<= num 14) (+ num 12))
                   ((<= num 16) (+ num 13))
                   ((<= num 20) (+ num 14)))))
            (when ansi
              (term-send-raw-string (format "\e[%d~" ansi)))))))))