iTerm Tab Customization

Word count: 200
Weird science of the day: an ancient frog - thanks to Seema for the link

With my new mac, I can take full advantage of all the iTerm tricks out there. iTerm itself is easy enough to download, but after that, things get hairy. Here’s a report on my struggle.

I’d already installed iTerm on the new mac, so I went straight to the iTerm tab customization instructions. From there I downloaded the file custom_iterm.dmg.tgz. None of the other links on this page are important, and the instructions themselves leave much to be desired.

I needed to download pos to the new mac. There was a version of it in the file above, but I wanted the fink version. Unfortunately, there are three files with the same name on that page, and no instructions anywhere on installing an unsupported fink package. I downloaded all three and diffed them to see which had the bug fixes - it seemed to be the one labelled “version 3″ so I went with that.

I’ve installed unsupported fink packages before, so I knew to sudo mv ~/Desktop/pos.info /sw/fink/dists/local/main/finkinfo/utils/ from the command line in iTerm. (I added the utils directory myself - it’s not necessary.)

For some reason I don’t quite understand, the traditional fink install pos still didn’t work - it kept telling me Failed: no package found for specification ‘pos’! Eventually I tried fink selfupdate, and after that fink install pos worked. The basics of pos, the little program that passes the directory name between the Finder and a terminal like iTerm, are explained on the Terminal-Finder Interaction page also maintained by wgscott.

So next up was installing that lovely Finder icon. I went to the fink-dependent folder in the disk image I downloaded earlier. Besides the link to fink.info, it contained an application and an applescript. Needless to say, there were no instructions. I copied the app, simple_iterm_cdf_fink, to my /Applications/Utilities folder and renamed it iTermer for brevity. Then I dragged it up into my finder toolbar, right next to the View options. It worked!

Next up was the Holy Grail of my iTerm efforts, the promised iterm tab customization. I was pleased to see that this step, at least, was well documented. I use tcsh, so I took the iterminal_custom.tcsh file from the Tab_title_customization folder in the disk image and put it, as advised, in ~/Library/Scripts/. Well, actually, there was no Scripts folder so I made one first. I put the .sh file in there, too, just in case I have a shell change-of-heart in the future. I added the line source ~/Library/Scripts/iterminal_custom.tcsh to my ~/.tcshrc file. Note that it should be all on one line.

I didn’t even quit iTerm - I just opened a new tab (command-t, if you haven’t figured it out) and voila! My tab had the directory name on it. It certainly beats a row of tabs all saying “Default session,” but with a little more documentation it would have been a lot less work.

There was one last issue - my prompt had been changed to the rather pedestrian test>. I opened ~/Library/Scripts/iterminal_custom.tcsh and the instructions for fixing that were right inside. I commented out the line with the boring prompt in it, and all was well with iTerm.

Comments are closed.