added support for preventing browser window leave with commands running without confirmation, closing shell connection terminates all commands