If the last VT100WorkingDirectory or VT100RemoteHost scrolls out of history then the info is lost
Maybe extend the length of the last VT100WorkingDirectory and VT100RemoteHost when the screen scrolls.
See this TODO:
// TODO: There's a bug here where remote host can scroll off the end of history, causing the
// working directory to come from PTYTask (which is what happens when nil is passed here).