I tend to run my shell in emacs, but when I use it to ssh into another computer this breaks tab-completion. Is there a way to fix this?
You can execute an external shell command from within Emacs using ` M-! ' ( 'shell-command' ). The output from the shell command is displayed in the minibuffer or in a separate buffer, depending on the output size.
TRAMP is for transparently accessing remote files from within Emacs. TRAMP enables an easy, convenient, and consistent interface to remote files as if they are local files.
Try:
M-x cd /hostname:/current/path/in/the/shell
That should set up ange-ftp (or tramp), and then TAB completion for paths should work properly for that shell - until you log into a different machine.
You could set up a comint process filter to recognize when you type ssh
to do that for you automatically, but that's difficult to get right as it should revert when you exit the ssh
session, but not be tricked by other uses of exit
.
For an automated solution, I'd suggest augmenting the approach I personally use to keep Emacs synchronized with the current working directory of the shell buffer. Just add an an extra bit of information with the hostname, and use that to set the hostname and path like shown above.
in another thread, someone mentioned eshell which I've never used but I tried it with SSH and all sorts of nice integration is happening. Time to learn eshell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With