More on TRAMP

Posted on Fri 29 October 2010 by alex in geek

I've mentioned TRAMP before. It's a very handy way of editing remote files. However I've been having a few problems with it today.

The most common access method used by TRAMP to access files these days is via ssh. It basically uses a remote terminal session to navigate the remote file system and fetch files back and forth. However it does take a few things for granted and one of those is the shell environment on the far end. For most *nix users this will be Bash. Long time command line hackers like myself usually have a rather heavily customised shell environment which can cause problems for TRAMP, especially if you pull tricks with customising the command prompt. In an effort to handle this a little better I modified my .bashrc to treat 'dumb' terminals as non-interactive. It works but it still seems a little hacky. I would welcome any better suggestions for detecting TRAMP sessions my start-up files.

I was still experiencing a problem navigating to one of the directories on my remote machine. Whatever I did when I got to the root of my code tree I couldn't navigate into the correct directory. The prompt would only offer me an old (since moved away) directory. Tricks like opening dired mode and navigating in would cause the session to spin consuming 100% cpu. In the end I tracked it down to IDO and the old directory existing in my ~/.ido.last file. Once removed and emacs restarted the problem went away. I'm hoping this is just a peculiarity of the interaction between ido and TRAMP but is was certainly annoying.