Next: , Previous: Interactive Shell, Up: Shell


26.7.3 Shell Mode

The shell buffer uses Shell mode, which defines several special keys attached to the C-c prefix. They are chosen to resemble the usual editing and job control characters present in shells that are not under SXEmacs, except that you must type C-c first. Here is a list of the special key bindings of Shell mode:

<RET>
At end of buffer send line as input; otherwise, copy current line to end of buffer and send it (send-shell-input). When a line is copied, any text at the beginning of the line that matches the variable shell-prompt-pattern is left out; this variable's value should be a regexp string that matches the prompts that you use in your subshell.
C-c C-d
Send end-of-file as input, probably causing the shell or its current subjob to finish (shell-send-eof).
C-d
If point is not at the end of the buffer, delete the next character just like most other modes. If point is at the end of the buffer, send end-of-file as input, instead of generating an error as in other modes (comint-delchar-or-maybe-eof).
C-c C-u
Kill all text that has yet to be sent as input (kill-shell-input).
C-c C-w
Kill a word before point (backward-kill-word).
C-c C-c
Interrupt the shell or its current subjob if any (interrupt-shell-subjob).
C-c C-z
Stop the shell or its current subjob if any (stop-shell-subjob).
C-c C-\
Send quit signal to the shell or its current subjob if any (quit-shell-subjob).
C-c C-o
Delete last batch of output from shell (kill-output-from-shell).
C-c C-r
Scroll top of last batch of output to top of window (show-output-from-shell).
C-c C-y
Copy the previous bunch of shell input and insert it into the buffer before point (copy-last-shell-input). No final newline is inserted, and the input copied is not resubmitted until you type <RET>.
M-p
Move backward through the input history. Search for a matching command if you have typed the beginning of a command (comint-previous-input).
M-n
Move forward through the input history. Useful when you are using <M-p> quickly and go past the desired command (comint-next-input).
<TAB>
Complete the file name preceding point (comint-dynamic-complete).