Use OSC 7 to find out current directory
Terminal.app and Gnome Terminal rely on the OSC 7 escape sequence to be printed by the shell telling the terminal the current directory, rather than using magic digging under /proc or similar to find it out. This is used when opening a new tab in the same directory as the previous.
This method has couple of advantages. E.g. it works if you have nested interactive shells, yet not mislead you when you run a script that changes directory internally. Also there's a patch for Midnight Commander to use this sequence, that way a new terminal is opened from whichever directory you're at in mc: http://www.midnight-commander.org/ticket/3088. I use mc all the time and find this very useful.
When Gnome Terminal made this change, Ubuntu folks weren't happy about possible breakages with old user setups, so they created a patch: The terminal uses the directory set by OSC 7 if it has ever encountered this sequence in the given tab, otherwise falls back to the old method of figuring out the cwd from /proc. It's at https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1132700.
I think it would be great if iTerm2 could also switch to this method, with or without the Ubuntu-style fallback as you'd prefer it.
(On a related note, there's an OSC 6 for telling the current file (as used by an editor) to Terminal.app; I've no clue what it's used for.)