Variable: term-control-seq-regexp

term-control-seq-regexp is a variable defined in term.el.gz.

Value

"\\(?:[�--]\\|[^\n]+\n\\|\\(?:[DM78c]\\|AnSiT[^\n]+\n\\|\\][^�--]*\\(?:\\|\\\\\\)?\\|\\[\\([0-?]*\\)[ -/]*[@-~]\\)\\)"

Documentation

Regexp matching control sequences handled by term.el.

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
;; Terminal emulation
;; This is the standard process filter for term buffers.
;; It emulates (most of the features of) a VT100/ANSI-style terminal.

;; References:
;; [ctlseqs]: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
;; [ECMA-48]: https://www.ecma-international.org/publications/standards/Ecma-048.htm
;; [vt100]: https://vt100.net/docs/vt100-ug/chapter3.html

(defconst term-control-seq-regexp
  (concat
   ;; A control character not matched in a longer sequence below,
   "\\(?:[\x00-\x19\x1C-\x1F]\\|"
   ;; some Emacs specific control sequences, implemented by
   ;; `term-command-hook',
   "\032[^\n]+\n\\|"
   ;; a C1 escape coded character (see [ECMA-48] section 5.3 "Elements
   ;; of the C1 set"),
   "\e\\(?:[DM78c]\\|"
   ;; another Emacs specific control sequence,
   "AnSiT[^\n]+\n\\|"
   ;; OSC (See [ECMA-48] section 8.3.89 "Operation System Command".)
   ;; The spec only allows 0x08-0x0d 0x20-7e, but this regexp also
   ;; allows non-ascii (UTF-8) characters.
   "\\][^\x00-\x07\x0e-\x1f\x7f]*\\(?:\a\\|\e\\\\\\)?\\|"
   ;; or an escape sequence (section 5.4 "Control Sequences"),
   "\\[\\([\x30-\x3F]*\\)[\x20-\x2F]*[\x40-\x7E]\\)\\)")
  "Regexp matching control sequences handled by term.el.")