On my mac, I have
$EDITOR set to
If I run my shell session under tmux, it opens the editor fine, but the command on the terminal never exits. However, this works fine on a terminal by itself, and also under screen, so it could be a tmux bug.
The solution to this problem lies in installing tmux MacOSX pasteboard, as pointed out by Daniel Beck in a comment above. Most of the explanation about this can be found is the second comment above, which I reproduce here for clarity:
So I decided to finally post it as the answer, although I'm not who devise it originally. Kudos for Daniel for pointing it out, and to Chris Johnsen for writing this fix for tmux on Mac OS X.