void (ConsoleCodeFragment command, final PyDebugCallback<Pair<String, Boolean>> callback) { if (firstExecution) { firstExecution = false; myConsoleView.addConsoleFolding(true, false); } myDebugProcess.consoleExec(command.getText(), new PyDebugCallback<>() { @Override public void ok(String value) { callback.ok(parseExecResponseString(value)); if (PyConsoleUtil.isCommandQueueEnabled(myProject)) { ApplicationManager.getApplication() .getService(CommandQueueForPythonConsoleService.class) .removeCommand(PythonDebugConsoleCommunication.this, false); } } @Override public void error(PyDebuggerException exception) { callback.error(exception); if (PyConsoleUtil.isCommandQueueEnabled(myProject)) { ApplicationManager.getApplication() .getService(CommandQueueForPythonConsoleService.class) .removeCommand(PythonDebugConsoleCommunication.this, true); } } }); }