Use command tracking to save running a process for whether the shell is dirty, similar to cwd tracking this will lead to more responsive UI and less work happening on update. https://github.com/microsoft/vscode/blob/a1bf964306d30a9bbccb404b1b653e5a02fe3052/src/vs/platform/terminal/node/childProcessMonitor.ts