When running plugin in a multi-threaded environment and boxes are deleted sometimes the current dir may have been deleted resulting in an exception thrown by Dir.getcwd. This uses the shell to determine the current dir instead of using Dir.getcwd to avoid this exception.