term-mode

term-mode is an interactive compiled Lisp function in `term.el'.


(term-mode)

Major mode for interacting with an inferior interpreter.
The interpreter name is same as buffer name, sans the asterisks.

There are two submodes: line mode and char mode. By default, you are
in char mode. In char sub-mode, each character (except
`term-escape-char') is sent immediately to the subprocess.
The escape character is equivalent to the usual meaning of C-x.

In line mode, you send a line of input at a time; use
M-x term-send-input to send.

In line mode, this maintains an input history of size
`term-input-ring-size', and you can access it with the commands
M-x term-next-input, M-x term-previous-input, and
M-x term-dynamic-list-input-ring. Input ring history expansion can be
achieved with the commands M-x term-replace-by-expanded-history or
M-x term-magic-space. Input ring expansion is controlled by the
variable `term-input-autoexpand', and addition is controlled by the
variable `term-input-ignoredups'.

Input to, and output from, the subprocess can cause the window to scroll to
the end of the buffer. See variables `term-scroll-to-bottom-on-input',
and `term-scroll-to-bottom-on-output'.

If you accidentally suspend your process, use M-x term-continue-subjob
to continue it.

This mode can be customized to create specific modes for running
particular subprocesses. This can be done by setting the hooks
`term-input-filter-functions', `term-input-filter',
`term-input-sender' and `term-get-old-input' to appropriate functions,
and the variable `term-prompt-regexp' to the appropriate regular
expression.

Commands in raw mode:

key binding
--- -------

C-@ .. C-b term-send-raw
C-d .. C-z term-send-raw
C-\ .. DEL term-send-raw

C-c Prefix Command
ESC Prefix Command
<S-insert> term-paste
<S-next> scroll-up
<S-prior> scroll-down
<backspace> term-send-backspace
<delete> term-send-del
<deletechar> term-send-del
<down> term-send-down
<end> term-send-end
<home> term-send-home
<insert> term-send-insert
<left> term-send-left
<mouse-2> term-mouse-paste
<next> term-send-next
<prior> term-send-prior
<remap> Prefix Command
<right> term-send-right
<up> term-send-up

C-c C-@ pop-global-mark
C-c C-a Prefix Command
C-c C-b list-buffers
C-c C-c term-send-raw
C-c C-d list-directory
C-c C-e eval-last-sexp
C-c C-f find-file
C-c TAB indent-rigidly
C-c C-j term-line-mode
C-c C-k term-char-mode
C-c C-l downcase-region
C-c RET Prefix Command
C-c C-n set-goal-column
C-c C-o delete-blank-lines
C-c C-p ctl-x-ctl-p-prefix
C-c C-q term-pager-toggle
C-c C-r find-file-read-only
C-c C-s save-buffer
C-c C-t transpose-lines
C-c C-u universal-argument
C-c C-v scroll-up-command
C-c C-w write-file
C-c C-x exchange-point-and-mark
C-c C-z suspend-frame
C-c ESC Prefix Command
C-c SPC rectangle-mark-mode
C-c # server-edit
C-c $ set-selective-display
C-c ' expand-abbrev
C-c ( kmacro-start-macro
C-c ) kmacro-end-macro
C-c * calc-dispatch
C-c + balance-windows
C-c - shrink-window-if-larger-than-buffer
C-c . set-fill-prefix
C-c 0 delete-window
C-c 1 delete-other-windows
C-c 2 split-window-below
C-c 3 split-window-right
C-c 4 ctl-x-4-prefix
C-c 5 ctl-x-5-prefix
C-c 6 2C-command
C-c 8 Prefix Command
C-c ; comment-set-column
C-c < scroll-left
C-c = what-cursor-position
C-c > scroll-right
C-c X Prefix Command
C-c [ backward-page
C-c ] forward-page
C-c ^ enlarge-window
C-c ` next-error
C-c a Prefix Command
C-c b switch-to-buffer
C-c d dired
C-c e kmacro-end-and-call-macro
C-c f set-fill-column
C-c h mark-whole-buffer
C-c i insert-file
C-c k kill-buffer
C-c l count-lines-page
C-c m compose-mail
C-c n Prefix Command
C-c o other-window
C-c q kbd-macro-query
C-c r Prefix Command
C-c s save-some-buffers
C-c u undo
C-c v vc-prefix-map
C-c z repeat
C-c { shrink-window-horizontally
C-c } enlarge-window-horizontally
C-c DEL backward-kill-sentence
C-c C-SPC pop-global-mark
C-c C-+ text-scale-adjust
C-c C-- text-scale-adjust
C-c C-0 text-scale-adjust
C-c C-= text-scale-adjust
C-c <C-left> previous-buffer
C-c <C-right> next-buffer
C-c <left> previous-buffer
C-c <right> next-buffer

C-M-@ .. M-N term-send-raw-meta
M-P .. M-Z term-send-raw-meta
M-\ .. M-DEL term-send-raw-meta

<remap> <self-insert-command> term-send-raw

C-c M-x execute-extended-command

C-c C-a C-l gud-refresh
C-c C-a C-w gud-watch

C-c C-k C-a kmacro-add-counter
C-c C-k C-c kmacro-set-counter
C-c C-k C-d kmacro-delete-ring-head
C-c C-k C-e kmacro-edit-macro-repeat
C-c C-k C-f kmacro-set-format
C-c C-k TAB kmacro-insert-counter
C-c C-k C-k kmacro-end-or-call-macro-repeat
C-c C-k C-l kmacro-call-ring-2nd-repeat
C-c C-k RET kmacro-edit-macro
C-c C-k C-n kmacro-cycle-ring-next
C-c C-k C-p kmacro-cycle-ring-previous
C-c C-k C-s kmacro-start-macro
C-c C-k C-t kmacro-swap-ring
C-c C-k C-v kmacro-view-macro-repeat
C-c C-k SPC kmacro-step-edit-macro
C-c C-k b kmacro-bind-to-key
C-c C-k e edit-kbd-macro
C-c C-k l kmacro-edit-lossage
C-c C-k n kmacro-name-last-macro
C-c C-k q kbd-macro-query
C-c C-k r apply-macro-to-region-lines
C-c C-k s kmacro-start-macro
C-c C-k x kmacro-to-register

C-c RET C-\ set-input-method
C-c RET F set-file-name-coding-system
C-c RET X set-next-selection-coding-system
C-c RET c universal-coding-system-argument
C-c RET f set-buffer-file-coding-system
C-c RET k set-keyboard-coding-system
C-c RET l set-language-environment
C-c RET p set-buffer-process-coding-system
C-c RET r revert-buffer-with-coding-system
C-c RET t set-terminal-coding-system
C-c RET x set-selection-coding-system

C-c C-p C-a add-new-page
C-c C-p C-d pages-directory
C-c C-p C-l set-page-delimiter
C-c C-p RET mark-page
C-c C-p C-n next-page
C-c C-p C-p previous-page
C-c C-p C-s search-pages
C-c C-p d pages-directory-for-addresses
C-c C-p s sort-pages-buffer

C-c ESC ESC repeat-complex-command
C-c M-: repeat-complex-command

C-c 4 C-f find-file-other-window
C-c 4 C-o display-buffer
C-c 4 . xref-find-definitions-other-window
C-c 4 0 kill-buffer-and-window
C-c 4 a add-change-log-entry-other-window
C-c 4 b switch-to-buffer-other-window
C-c 4 c clone-indirect-buffer-other-window
C-c 4 d dired-other-window
C-c 4 f find-file-other-window
C-c 4 m compose-mail-other-window
C-c 4 r find-file-read-only-other-window

C-c 5 C-f find-file-other-frame
C-c 5 C-o display-buffer-other-frame
C-c 5 . xref-find-definitions-other-frame
C-c 5 0 delete-frame
C-c 5 1 delete-other-frames
C-c 5 2 make-frame-command
C-c 5 b switch-to-buffer-other-frame
C-c 5 d dired-other-frame
C-c 5 f find-file-other-frame
C-c 5 m compose-mail-other-frame
C-c 5 o other-frame
C-c 5 r find-file-read-only-other-frame

C-c 6 2 2C-two-columns
C-c 6 b 2C-associate-buffer
C-c 6 s 2C-split
C-c 6 <f2> 2C-two-columns

C-c 8 RET insert-char

C-c X SPC edebug-step-mode
C-c X = edebug-display-freq-count
C-c X C edebug-Continue-fast-mode
C-c X G edebug-Go-nonstop-mode
C-c X Q edebug-top-level-nonstop
C-c X T edebug-Trace-fast-mode
C-c X W edebug-toggle-save-windows
C-c X X edebug-set-global-break-condition
C-c X a abort-recursive-edit
C-c X b edebug-set-breakpoint
C-c X c edebug-continue-mode
C-c X g edebug-go-mode
C-c X q top-level
C-c X t edebug-trace-mode
C-c X u edebug-unset-breakpoint
C-c X w edebug-where
C-c X x edebug-set-conditional-breakpoint

C-c a C-a add-mode-abbrev
C-c a ' expand-abbrev
C-c a + add-mode-abbrev
C-c a - inverse-add-global-abbrev
C-c a e expand-abbrev
C-c a g add-global-abbrev
C-c a i Prefix Command
C-c a l add-mode-abbrev
C-c a n expand-jump-to-next-slot
C-c a p expand-jump-to-previous-slot

C-c n b org-narrow-to-block
C-c n d narrow-to-defun
C-c n e org-narrow-to-element
C-c n n narrow-to-region
C-c n p narrow-to-page
C-c n s org-narrow-to-subtree
C-c n w widen

C-c r C-@ point-to-register
C-c r ESC Prefix Command
C-c r SPC point-to-register
C-c r + increment-register
C-c r N rectangle-number-lines
C-c r b bookmark-jump
C-c r c clear-rectangle
C-c r d delete-rectangle
C-c r f frameset-to-register
C-c r g insert-register
C-c r i insert-register
C-c r j jump-to-register
C-c r k kill-rectangle
C-c r l bookmark-bmenu-list
C-c r m bookmark-set
C-c r n number-to-register
C-c r o open-rectangle
C-c r r copy-rectangle-to-register
C-c r s copy-to-register
C-c r t string-rectangle
C-c r w window-configuration-to-register
C-c r x copy-to-register
C-c r y yank-rectangle
C-c r C-SPC point-to-register

C-c v + vc-update
C-c v = vc-diff
C-c v D vc-root-diff
C-c v G vc-ignore
C-c v I vc-log-incoming
C-c v L vc-print-root-log
C-c v O vc-log-outgoing
C-c v [ Prefix Command
C-c v a vc-update-change-log
C-c v b vc-switch-backend
C-c v d vc-dir
C-c v g vc-annotate
C-c v h vc-insert-headers
C-c v i vc-register
C-c v l vc-print-log
C-c v m vc-merge
C-c v r vc-retrieve-tag
C-c v s vc-create-tag
C-c v u vc-revert
C-c v v vc-next-action
C-c v ~ vc-revision-other-window

C-c a i g inverse-add-global-abbrev
C-c a i l inverse-add-mode-abbrev

C-c r M-w copy-rectangle-as-kill

C-c v [ d Prefix Command

C-c v [ d e Prefix Command

C-c v [ d e l Prefix Command

C-c v [ d e l e Prefix Command

C-c v [ d e l e t Prefix Command

C-c v [ d e l e t e Prefix Command

C-c v [ d e l e t e ] vc-delete-file



Commands in line mode:

key binding
--- -------

C-c Prefix Command
C-d term-delchar-or-maybe-eof
RET term-send-input
ESC Prefix Command

C-c C-a term-bol
C-c C-c term-interrupt-subjob
C-c C-d term-send-eof
C-c C-e term-show-maximum-output
C-c C-j term-line-mode
C-c C-k term-char-mode
C-c C-l term-dynamic-list-input-ring
C-c RET term-copy-old-input
C-c C-n term-next-prompt
C-c C-o term-kill-output
C-c C-p term-previous-prompt
C-c C-q term-pager-toggle
C-c C-r term-show-output
C-c C-u term-kill-input
C-c C-w backward-kill-word
C-c C-z term-stop-subjob
C-c C-\ term-quit-subjob

C-M-l term-show-output
M-n term-next-input
M-p term-previous-input
M-r term-previous-matching-input
M-s term-next-matching-input
A-M-r term-previous-matching-input-from-input
A-M-s term-next-matching-input-from-input



Entry to this mode runs the hooks on `term-mode-hook'.