MacOS X is a harsh mistress

perrin on 2007-09-30T23:23:59

When MacOS X came out, combining things I like about the Mac with Unix, I was tempted. But I waited. I figured I'd give them time to iron out the bugs, time for the hardware to catch up to the new rendering technology, etc.

Now that Macs are running Intel chips, I figured I had waited long enough, and I bought one of the new iMacs. It's a really nice machine, and except for some glitchy rendering here and there (tooltips that remain on the screen, for example), it's a solid OS.

However, getting a dev environment that's as productive as Linux has been a real chore. Here are some of the things I've been dealing with:

Terminals

You don't expect to spend a lot of time fussing with terminals these days. They should just work, right? Well, I first tried the terminal app that comes with the OS. It had broken key mappings for page up/down, which I fixed. It also makes only a really half-hearted attempt to do X11-style mouse paste, which is really irritating since I'm so accustomed to it.

I tried an alternative, called iTerm. It has better mouse paste support, but it has broken arrow key mappings. When was the last time you had to fix your arrow keys on Linux? It's like 1997 all over again.

Both of these seem to confuse my screen session about their terminal capabilities. iTerm does better at showing color (e.g. in man page headings) but both of them cause screen to do its horrific visual bell ("Wuff wuff!") until I manually tell it to use a normal bell.

Text Editors

Everyone seems to love TextMate. I do plan to try it, but it's very unlikely that I'm going to pay $80 for a closed source text editor in this day and age. If you're one of those people who loves TextMate and thinks it's worth the money, I'd be interested to hear your reasons.

I have tried TextWrangler, and found it pretty decent in some ways. I got perltidy wired up to it without trouble, and the SFTP browser is pretty lame, but works. I also like the Emacs key support. However, it has no code folding, and the syntax coloring is pretty weak compared to most Linux editors, like Kate, vim, and Emacs.

I tried Eclipse + EPIC, which is actually better than I expected. Syntax coloring is nice, and it feels pretty responsive. On the downside, I can't figure out how to make a filter for perltidy to work on just a selected region rather than a whole file. I also can't figure out how to get .html files with Mason code in them to switch into Perl mode. And then there's all the project-oriented Java cruft in the menus.

I tried a promising-looking Emacs port called Aquamacs. It's Emacs with keys remapped to normal Mac bindings, and easy-to-use font menus, separate windows for each buffer, etc. It looked pretty nice, but none of the elisp extensions I want to use (tramp, mmm-mode) seem to work with it. I admit to being a novice at this stuff, but I gave it a pretty good try and couldn't make them work.

The Carbon Emacs package from Apple worked great with elisp packages. In fact, it's really nice all-around: good syntax coloring from cperl and mmm-mode, tramp for SSH access, easy perltidy integration. The only real issue I've had with it is how poorly it plays with the rest of the Mac. Copying and pasting something from the terminal or Firefox into it seems to require some tricky incantations. I haven't been able to do it without resorting to clicking on menus. I suspect there's three or more different copy/paste systems happening at once here and they are not playing well together. It also took me a crazy amount of effort to change my font size, which is very non-Mac but somewhat expected from Emacs.

Overall I do like my Mac, but it's disturbing how reminiscent of the early days of Linux this has been. I may resort to running X11 with an xterm and maybe Kate if I can figure out how to get it running. I figure if I have to I can always run a double-boot (or Parallels) with Fedora. If anyone has tips about getting X11 mouse paste to work on the Mac, or taming Carbon Emacs, or getting Kate to run, pass them over.


I'm not a mac user, but...

mpeters on 2007-10-01T01:09:06

As far as editors go, have you tried Active State's Komodo? They just open sourced it not too long ago and I've heard some good things about it:

http://www.activestate.com/openkomodo/

It's built on Mozilla/XUL technologies so if the copy-paste in FF works in OSX, then it should work in komodo too.

iTerm, Emacs and Quicksilver

jonswar on 2007-10-01T03:01:32

I too was frustrated by the lack of a good terminal program to replace Windows' SecureCRT, but iTerm finally won me over with its extremely flexible key mappings. Any keys that don't work the way you expect, you can almost surely remap. I also like the ability to move sessions in and out of tabs, and "Send Input to all Tabs" is a great lazy way to handle repetitive tasks.

For editing, I use the Carbon Emacs builds at http://www.porkrind.org/emacs/ - many varieties of both 22 and 23 are available. Never had a problem with cut and paste - content goes to and from the Mac clipboard seamlessly.

And I assume you've heard this, but if you value productivity, install and learn Quicksilver (or one of its competitors) immediately.

Once you've got Quicksilver and Emacs set up, much of the rest of the "OS" becomes much less relevant. :)

TextMate

perigrin on 2007-10-01T05:58:21

First I've never learned (or bothered to learn) Emacs ... I was taught by my mother* that if you're gonna learn a Unix editor learn vi cause it's everywhere. Second, I started out using Windows and have always preferred a GUI editor. I don't know why but I like tabs and windows to click on.

TextMate won my heart because it worked naturally with what I expected and was very easy (for me as a novice) to customize in the few places I wanted more. I can write extension commands in Shell or Perl (or Ruby or Python or I guess elisp if you're sadistic). I can write my own syntax files fairly easily (and have done so for Moose). And it naturally does exactly what I want when I start on a project. In a shell I can type mate ~/dev/MyProject and TextMate will open up a project screen with the MyProject fileystem in a browser panel and files I click on will open in tabs. This perfectly fits my method of work. Finally there is a large contributor base adding new bundles for new languages and features all the time (though the Perl bundle seems to be stagnet ... probably should do something about that).

If you're someone who has spent a ton of time getting to know and love a different editor TextMate probably isn't for you. If you're someone who hasn't spent that time, TextMate is at least worth the trial period to test out and see if it can work for you.

Also, the suggestion for downloading and using QuickSilver is a good one. QuickSilver is the closest to the Unix command line I've seen in a GUI application (pipes/small tools/yadda yadda yadda). I probably don't use half of it's power and I can't imagine my mac without it.

* Mom was a software engineer for thirty something years. Try growing up with horror stories of why you don't drop your punch cards.

Issues I had with Mac OS X

hex on 2007-10-01T10:43:59

...were largely on the interface side. I wrote down my accumulated tips on the subject, though I don't expect them to appeal to everyone's tastes.

iTerm plus regular emacs

Phred on 2007-10-01T17:36:28

I've been using iTerm with good old terminal based emacs and vi and it has been working pretty well. I was using Aquamacs for a while, but I ended up with a desktop full of buffers and found it easier to keep them hidden in iTerm.

One really annoying thing about running emacs in the terminal is that you have to use ESC for the meta key. But I've been able to trick out emacs using perlnow and an autocomplete elisp (https://www.redhotpenguin.com/svn/emacs/) setup so while there are some nits in the system, my overall productivity using it is pretty good.

I've fallen in love with iTerm though. I just wish that I could resize the window using the keyboard instead of having to expend great effort with the one button mouse on the laptop to resize it to fit the screen vertically. I've tried Parallels and it takes up too many resources to be effective on the laptop, but you may find differently on the desktop. There are some annoyances with it (can't cut and paste from the mac buffer to the virtual machine), which they may have ironed out in 3.0 (but my year of upgrades doesn't cover 2.x to 3 :( )