iTerm2 is a terminal emulator for Mac OS X that does amazing things.
This site hosts code for iTerm2.