Here's a snippet that enables tramp filename completion in ssh shells.  When you ssh to a remote host in a shell, it will set comint-file-name-prefix . . .