File: shell.el.html
This file defines a shell-in-a-buffer package (shell mode) built on top of comint mode.
Since this mode is built on top of the general command-interpreter-in- a-buffer mode (comint mode), it shares a common base functionality, and a common set of bindings, with all modes derived from comint mode. This makes these modes easier to use.
For documentation on the functionality provided by comint mode, and the hooks available for customizing it, see the file comint.el. For further information on shell mode, see the comments below.
Needs fixing: When sending text from a source file to a subprocess, the process-mark can move off the window, so you can lose sight of the process interactions. Maybe I should ensure the process mark is in the window when I send text to the process? Switch selectable?
YOUR .EMACS FILE
=============================================================================
Some suggestions for your init file.
;; Define M-# to run some strange command:
(with-eval-after-load 'shell
(keymap-set shell-mode-map "M-#" 'shells-dynamic-spell))
Brief Command Documentation:
============================================================================
Comint Mode Commands: (common to shell and all comint-derived modes)
m-p comint-previous-input Cycle backwards in input history
m-n comint-next-input Cycle forwards
m-r comint-previous-matching-input Previous input matching a regexp
m-s comint-next-matching-input Next input that matches
m-c-l comint-show-output Show last batch of process output
return comint-send-input
c-d comint-delchar-or-maybe-eof Delete char unless at end of buff.
c-c c-a comint-bol Beginning of line; skip prompt
c-c c-u comint-kill-input ^u
c-c c-w backward-kill-word ^w
c-c c-c comint-interrupt-subjob ^c
c-c c-z comint-stop-subjob ^z
c-c c-\ comint-quit-subjob ^\
c-c c-o comint-delete-output Delete last batch of process output
c-c c-r comint-show-output Show last batch of process output
c-c c-l comint-dynamic-list-input-ring List input history
comint-send-invisible Read line without echo & send to proc
comint-continue-subjob Useful if you accidentally suspend
top-level job
comint-mode-hook is the comint mode hook.
Shell Mode Commands:
shell Fires up the shell process
tab completion-at-point Complete filename/command/history
m-? comint-dynamic-list-filename-completions
List completions in help buffer
c-c c-f shell-forward-command Forward a shell command
c-c c-b shell-backward-command Backward a shell command
dirs Resync the buffer's dir stack
shell-dirtrack-mode Turn dir tracking on/off
comint-strip-ctrl-m Remove trailing ^Ms from output
The shell mode hook is shell-mode-hook comint-prompt-regexp is initialized to shell-prompt-pattern, for backwards compatibility.
Read the rest of this file for more information.
Defined variables (55)
explicit-bash-args | Args passed to inferior shell by M-x shell, if the shell is bash. |
explicit-csh-args | Args passed to inferior shell by M-x shell, if the shell is csh. |
explicit-shell-file-name | If non-nil, the file name to use for explicitly requested inferior shells. |
shell--highlight-undef-exec-cache | Cache of executable files found in ‘exec-path’. |
shell--highlight-undef-indirect | Non-nil if shell commands are fontified in ‘comint-indirect-buffer’. |
shell--start-prog | Shell file name started in ‘shell’. |
shell-bookmark-defaults-function | Function to generate a list of default shell bookmark names. |
shell-bookmark-jump-non-essential | If non-nil, new remote connections are inhibited in shell-bookmark-jump. |
shell-bookmark-name-function | Function to generate a shell bookmark name. |
shell-cd-regexp | Regexp to match subshell commands equivalent to cd. |
shell-chdrive-regexp | If non-nil, is regexp used to track drive changes. |
shell-command-mode-abbrev-table | Abbrev table for ‘shell-command-mode’. |
shell-command-mode-hook | Hook run after entering ‘shell-command-mode’. |
shell-command-mode-map | Keymap for ‘shell-command-mode’. |
shell-command-mode-syntax-table | Syntax table for ‘shell-command-mode’. |
shell-command-regexp | Regexp to match a single command within a pipeline. |
shell-command-separator-regexp | Regexp to match a single command within a pipeline. |
shell-completion-execonly | If non-nil, use executable files only for completion candidates. |
shell-completion-fignore | List of suffixes to be disregarded during file/command completion. |
shell-delimiter-argument-list | List of characters to recognize as separate arguments. |
shell-dirstack | List of directories saved by pushd in this buffer’s shell. |
shell-dirstack-query | Command used by ‘shell-resync-dirs’ to query the shell. |
shell-dirtrack-mode | Non-nil if Shell-Dirtrack mode is enabled. |
shell-dirtrack-mode-hook | Hook run after entering or leaving ‘shell-dirtrack-mode’. |
shell-dirtrack-verbose | If non-nil, show the directory stack following directory change. |
shell-dirtrackp | Non-nil in a shell buffer means directory tracking is enabled. |
shell-dumb-shell-regexp | Regexp to match shells that don’t save their command history, and |
shell-dynamic-complete-functions | List of functions called to perform completion. |
shell-file-name-chars | String of characters valid in a file name. |
shell-file-name-quote-list | List of characters to quote when in a file name. |
shell-font-lock-keywords | Additional expressions to highlight in Shell mode. |
shell-fontify-input-enable | Enable fontification of input in shell buffers. |
shell-get-old-input-include-continuation-lines | Whether ‘shell-get-old-input’ includes "\" lines. |
shell-has-auto-cd | If non-nil, ‘shell-mode’ handles implicit "cd" commands. |
shell-highlight-undef-aliases | List of shell commands to highlight as a command alias. |
shell-highlight-undef-enable | Enable highlighting of undefined commands in shell buffers. |
shell-highlight-undef-mode | Non-nil if Shell-Highlight-Undef mode is enabled. |
shell-highlight-undef-mode-hook | Hook run after entering or leaving ‘shell-highlight-undef-mode’. |
shell-highlight-undef-remote-file-name-inhibit-cache | Whether to inhibit cache for fontifying shell commands in remote buffers. |
shell-history-file-name | The history file name used in ‘shell-mode’. |
shell-indirect-setup-hook | Hook run in an indirect buffer for input fontification. |
shell-input-autoexpand | If non-nil, expand input command history references on completion. |
shell-kill-buffer-on-exit | Kill a shell buffer after the shell process terminates. |
shell-last-dir | Keep track of last directory for ksh ‘cd -’ command. |
shell-mode-abbrev-table | Abbrev table for ‘shell-mode’. |
shell-mode-hook | Hook for customizing Shell mode. |
shell-mode-map | Keymap for ‘shell-mode’. |
shell-mode-syntax-table | Syntax table for ‘shell-mode’. |
shell-popd-regexp | Regexp to match subshell commands equivalent to popd. |
shell-prompt-pattern | Regexp to match prompts in the inferior shell. |
shell-pushd-dextract | If non-nil, make "pushd +n" pop the nth dir to the stack top. |
shell-pushd-dunique | If non-nil, make pushd only add unique directories to the stack. |
shell-pushd-regexp | Regexp to match subshell commands equivalent to pushd. |
shell-pushd-tohome | If non-nil, make pushd with no arg behave as "pushd ~" (like cd). |
shell-repeat-map | Keymap to repeat shell key sequences. Used in ‘repeat-mode’. |
Defined functions (52)
Defined faces (3)
shell-highlight-undef-alias-face | Face used for shell command aliases. |
shell-highlight-undef-defined-face | Face used for existing shell commands. |
shell-highlight-undef-undefined-face | Face used for non-existent shell commands. |