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?
I just wrote a little function to open a shell on a remote host. The cd call before shell gets the tab completion working.
This may be different than you want, since it opens a new shell instead of ssh'ing in a local shell. Beyond that, you could look into hacking emacs Directory Tracking (or see who else has).
(defun remote-shell (&optional host)
"Open a remote shell to a host."
(interactive)
(with-temp-buffer
(let ((host (if host host (read-string "Host: "))))
(cd (concat "/scp:" host ":"))
(shell (concat "*" host "*")))))
(defun myserver-shell () (interactive) (remote-shell "myserver"))