Added option to prevent changing directory for shell cmds