isDirectoryChangingCommand function
Check if a command modifies the working directory.
Implementation
bool isDirectoryChangingCommand(String command) {
final exe = extractExecutable(command);
if (exe == null) return false;
return exe == 'cd' || exe == 'pushd' || exe == 'popd';
}