3 ms·
There are some semantics differences, e.g. if a remote buffer is open then `shell-command` (M-!) will run commands on the remote machine and `shell` will open a
by chriswarbo 6y ago
There are some semantics differences, e.g. if a remote buffer is open then `shell-command` (M-!) will run commands on the remote machine and `shell` will open a terminal which is logged in to the remote machine. I run all my terminals in Emacs, so I use these a lot (my init.el wraps the latter in a function which invents new buffer names shell-1, shell-2, etc.).
TRAMP also feels faster to me; I presume it's due to background jobs adjusting their casual I/O usage when TRAMP is detected, like writing backup/lock files, scanning directories for VCS info, etc. which has high latency on SSHFS.
I also like using `/sudo:root@localhost:/foo` for editing local files with different user permissions (plus the same command and terminal behaviour as with SSH)
- ProfDreamer 6y agomulti-hops[0] should probably be mentioned as well. Using those one can for example open a file using sudo via ssh: /ssh:you@remotehost|sudo:remotehost:/path Doing any further actions on a file opened that way also applies the hops there as well. For the example above opening a shell or running a shell-command would run those through sudo on the remote host. [0]: https://www.gnu.org/software/emacs/manual/html_node/tramp/Ad_002dhoc-multi_002dhops.html https://www.gnu.org/software/emacs/manual/html_node/tramp/Ad...
- kqr 6y agoIt's worth mentioning that this is not limited to SSH followed by sudo. It can also be used to edit remote files through a bastion host, by just adding more SSH hops to the file path.