Consider using the VTE/Terminal.app mechanism for CWD/host reporting
OS X's Terminal.app and gnome terminal have a common mechanism for the shell to report the current working directory and current hostname which is decently well supported out there. It may be a nice idea for iTerm to handle these escapes to better inform the directory history when using shells without integration installed and simplify the integration work necessary otherwise.
The working directory and location of the current document may be set using the Operating System Command (OSC) escape sequence:
ESC ] Ps ; Pt BEL
The parameter Ps is either 6 (document) or 7 (working directory) and Pt is a “file:” URL. The URL should include a hostname to disambiguate local and remote paths, and characters must be percent-encoded as appropriate.
When both the working directory and document are set only the document is displayed.
ie. one may get a cwd of file://mycomputer.local/home/floam/src.