<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alex's Adventures on the Infobahn - tramp</title><link href="https://www.bennee.com/~alex/" rel="alternate"></link><link href="https://www.bennee.com/~alex/blog/tag/tramp/feed" rel="self"></link><id>https://www.bennee.com/~alex/</id><updated>2010-10-29T12:10:00+01:00</updated><subtitle>the wanderings of a supposed digital native</subtitle><entry><title>More on TRAMP</title><link href="https://www.bennee.com/~alex/blog/2010/10/29/more-on-tramp/" rel="alternate"></link><published>2010-10-29T12:10:00+01:00</published><updated>2010-10-29T12:10:00+01:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2010-10-29:/~alex/blog/2010/10/29/more-on-tramp/</id><summary type="html">&lt;p&gt;I've mentioned &lt;a class="reference external" href="http://www.bennee.com/~alex/blog/2010/07/29/the-power-of-tramp/"&gt;TRAMP before&lt;/a&gt;. It's a very handy way of editing remote files. However I've been having a few problems with it today.&lt;/p&gt;
&lt;p&gt;The most common access method used by TRAMP to access files these days is via &lt;em&gt;ssh&lt;/em&gt;. It basically uses a remote terminal session to navigate the remote …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've mentioned &lt;a class="reference external" href="http://www.bennee.com/~alex/blog/2010/07/29/the-power-of-tramp/"&gt;TRAMP before&lt;/a&gt;. It's a very handy way of editing remote files. However I've been having a few problems with it today.&lt;/p&gt;
&lt;p&gt;The most common access method used by TRAMP to access files these days is via &lt;em&gt;ssh&lt;/em&gt;. 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 &lt;a class="reference external" href="http://en.wikipedia.org/wiki/Bash_(Unix_shell)"&gt;Bash&lt;/a&gt;. Long time command line hackers like myself usually have a rather &lt;a class="reference external" href="http://github.com/stsquad/dotfiles"&gt;heavily customised&lt;/a&gt; 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 &lt;a class="reference external" href="http://github.com/stsquad/dotfiles/commit/126f32ff538214e3de4b40993a3406a15379ec45"&gt;modified&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;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 &lt;a class="reference external" href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Dired.html"&gt;dired mode&lt;/a&gt; and navigating in would cause the session to spin consuming 100% cpu. In the end I tracked it down to &lt;a class="reference external" href="http://www.emacswiki.org/emacs/InteractivelyDoThings"&gt;IDO&lt;/a&gt; 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.&lt;/p&gt;
</content><category term="geek"></category><category term="emacs"></category><category term="tramp"></category></entry><entry><title>The power of Tramp</title><link href="https://www.bennee.com/~alex/blog/2010/07/29/the-power-of-tramp/" rel="alternate"></link><published>2010-07-29T08:06:00+01:00</published><updated>2010-07-29T08:06:00+01:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2010-07-29:/~alex/blog/2010/07/29/the-power-of-tramp/</id><summary type="html">&lt;p&gt;The project I've been working on at work the last few weeks has involved bringing up a brand new embedded system. As part of that I've been tweaking a lot of start-up scripts and configuration files on the new system.&lt;/p&gt;
&lt;p&gt;For part of that task I've installed &lt;a class="reference external" href="http://www.gnu.org/software/zile/"&gt;GNU Zile&lt;/a&gt; which …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The project I've been working on at work the last few weeks has involved bringing up a brand new embedded system. As part of that I've been tweaking a lot of start-up scripts and configuration files on the new system.&lt;/p&gt;
&lt;p&gt;For part of that task I've installed &lt;a class="reference external" href="http://www.gnu.org/software/zile/"&gt;GNU Zile&lt;/a&gt; which provides a nice Emacs-like experience for quick edits where you would usually fire-up &lt;em&gt;vi&lt;/em&gt;. Despite the fact the new platform has a considerably larger backing store I'm not going to install the full-fat Emacs just to satisfy my editing needs.&lt;/p&gt;
&lt;p&gt;Fortunately the full-fat Emacs has long carried a feature called TRAMP (standing for &amp;quot;Transparent Remote (file) Access, Multiple Protocol&amp;quot;) which is incredibly useful in this and other use cases. TRAMP allows you to edit files on remote machines in your normal home Emacs environment. &lt;em&gt;find-file&lt;/em&gt; and friends all behave as if you are editing local files while behind the scenes Emacs pulls directory listings and files from the remote machine with ssh (or ftp or whatever actually works). I use TRAMP all the time to edit files on the rather ancient build machine rather the using the relatively ancient Emacs it has installed on it.&lt;/p&gt;
&lt;p&gt;There was one minor wrinkle getting TRAMP working with my new embedded system. As some of the methods used to move files back and forth are designed for transferring text files Emacs goes to great pains to ensure the files are moved across un-mangled. Typically this involves some sort of encode/decode utility. The tramp code is actually quite a good example of using elisp in an extensible way and if you look at &lt;em&gt;tramp-remote-coding-commands&lt;/em&gt; you'll see it will even fall back to running remote in-line perl if it has to. As it happens we don't have perl running on the embedded platform and as it would be a little overkill to put perl on the remote machine so I added the recode utility.&lt;/p&gt;
&lt;p&gt;I consider TRAMP to be one of Emacs' killer features. Next time you sigh at the prospect of being consigned to an inferior editor on some remote box consider visiting the file with TRAMP straight from your current Emacs session.&lt;/p&gt;
</content><category term="geek"></category><category term="emacs"></category><category term="remote-editing"></category><category term="tramp"></category></entry></feed>