Emacs remote shell

前端 未结 7 1280
小鲜肉
小鲜肉 2020-12-30 09:53

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?

7条回答
  •  渐次进展
    2020-12-30 10:20

    M-x shell invoked in buffer A will switch to a shell buffer B; usually shell. Unsurprisingly it creates B if necessary. A prefix arg will cause it to ask for the name of B. If A is viewing something on a remote host then the shell will be run on the remote host. But only if it can't find an existing B. At that point file name completion will work.

    There are some notes about how to tinker with this in the emacs wiki. See for example the function my-shell in this section, which will extend the default name for B so remote files get remote shells. I do that same thing by advising the shell function.

    The filename auto completion will work fine. Command autocomplete? Less so. For me it blocks emacs and then doesn't actually work.

提交回复
热议问题