private AnActionEvent stopConsole(AnActionEvent e) {
   if (myPydevConsoleCommunication != null) {
     e =
         new AnActionEvent(
             e.getInputEvent(),
             e.getDataContext(),
             e.getPlace(),
             e.getPresentation(),
             e.getActionManager(),
             e.getModifiers());
     try {
       closeCommunication();
       // waiting for REPL communication before destroying process handler
       Thread.sleep(300);
     } catch (Exception ignored) {
       // Ignore
     }
   }
   return e;
 }