tags:

views:

495

answers:

4
+1  Q: 

emacs Remote Shell

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?

+2  A: 

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.

Trey Jackson
A: 

You could try M-x ansi-term to host your shell if your getting unexpected behavior with key mappings. Having said that I couldn't re-produce the problem your describing on your set-up.

stsquad
A: 

I had a similar problem I think and solved it by editing my ~/.bash_login on the remove machine and append

export TERM=xterm

I use OS X and had problems when connecting to a Linux (Debian Lenny)

cb0
+1  A: 

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.

r giar