Setup tramp and shell-mode for interactive shells and remote file editing. Supports local shells, ssh, sudo, docker and kubernetes.
Clone this repository and add to load-path
:
(add-to-list 'load-path "~/.emacs.d/emacs-shell")
(require 'emacs-shell)
To start interactive shells, use these commands:
Command | Description |
---|---|
M-x localhost-shell |
Shell on localhost |
M-x ssh-shell |
Shell on remote host |
M-x sudo-shell |
Root shell (localhost or remote) |
M-x docker-shell |
Shell in local docker container |
M-x pod-shell |
Shell in kubernetes pod |
Bash will be started if available, and your .bashrc
on the emacs host will be sourced in the remote shell. Shell history will also be saved in
individual files on the emacs host (.emacs.d/shell-history
directory), so history is kept between sessions even if pods have been restarted etc.
In addition to the bindings from shell-mode, these keybindings are added:
Keys | Where | Description |
---|---|---|
S-C-n |
global | Start new localhost shell |
C-p |
shell-mode | Previous history |
C-n |
shell-mode | Next history |
C-c C-c |
password input | Abort command |