Function: term-char-mode

term-char-mode is an interactive and byte-compiled function defined in term.el.gz.

Signature

(term-char-mode)

Documentation

Switch to char ("raw") sub-mode of term mode.

Each character you type is sent directly to the inferior without intervention from Emacs, except for the escape character (usually \C-c).

View in manual

Probably introduced at or before Emacs version 26.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/term.el.gz
(defun term-char-mode ()
  "Switch to char (\"raw\") sub-mode of term mode.
Each character you type is sent directly to the inferior without
intervention from Emacs, except for the escape character (usually \\`C-c')."
  (interactive)
  ;; FIXME: Emit message? Cfr ilisp-raw-message
  (when (term-in-line-mode)
    (setq term-old-mode-map (current-local-map))
    (use-local-map term-raw-map)

    ;; Don't allow changes to the buffer or to point which are not
    ;; caused by the process filter.
    (when term-char-mode-buffer-read-only
      (setq buffer-read-only t))
    (add-hook 'pre-command-hook #'term-set-goto-process-mark nil t)
    (add-hook 'post-command-hook #'term-goto-process-mark-maybe nil t)

    ;; Send existing partial line to inferior (without newline).
    (let ((pmark (process-mark (get-buffer-process (current-buffer)))))
      (when (> (point) pmark)
	(unwind-protect
	    (progn
	      (add-function :override (local 'term-input-sender) #'term-send-string)
	      (end-of-line)
	      (term-send-input))
	  (remove-function (local 'term-input-sender) #'term-send-string))))
    (term-update-mode-line)))