Source:
<code>public void connect() { if (connected_ || connecting_) return; connecting_ = true; setNewTerminal(getHandle() == null); server_.startTerminal(80, 25, getHandle(), getTitle(), getSequence(), new ServerRequestCallback<ConsoleProcess>() { @Override public void onResponseReceived(ConsoleProcess consoleProcess) { consoleProcess_ = consoleProcess; <START> <END> if (getInteractionMode() != ConsoleProcessInfo.INTERACTION_ALWAYS) { writeError("Unsupported ConsoleProcess interaction mode"); disconnect(); return; } if (consoleProcess_ != null) { addHandlerRegistration(consoleProcess_.addConsoleOutputHandler(TerminalSession.this)); addHandlerRegistration(consoleProcess_.addProcessExitHandler(TerminalSession.this)); addHandlerRegistration(addResizeTerminalHandler(TerminalSession.this)); addHandlerRegistration(addTerminalTitleHandler(TerminalSession.this)); addHandlerRegistration(eventBus_.addHandler(SessionSerializationEvent.TYPE, TerminalSession.this)); if (terminalInputHandler_ == null) terminalInputHandler_ = addTerminalDataInputHandler(TerminalSession.this); consoleProcess.start(new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { connected_ = true; connecting_ = false; flushQueuedInput(); eventBus_.fireEvent(new TerminalSessionStartedEvent(TerminalSession.this)); } @Override public void onError(ServerError error) { disconnect(); writeError(error.getUserMessage()); } }); } } @Override public void onError(ServerError error) { disconnect(); writeError(error.getUserMessage()); } }); }</code><technical_language>If consoleProcess_ is null, left in connecting_ state indefinitely here. Intentional</technical_language>

Target:
public void connect() { if (connected_ || connecting_) return; connecting_ = true; setNewTerminal(getHandle() == null); server_.startTerminal(80, 25, getHandle(), getTitle(), getSequence(), new ServerRequestCallback<ConsoleProcess>() { @Override public void onResponseReceived(ConsoleProcess consoleProcess) { consoleProcess_ = consoleProcess; if (consoleProcess_ == null) { writeError("No ConsoleProcess received from server"); disconnect(); return; } if (getInteractionMode() != ConsoleProcessInfo.INTERACTION_ALWAYS) { writeError("Unsupported ConsoleProcess interaction mode"); disconnect(); return; } addHandlerRegistration(consoleProcess_.addConsoleOutputHandler(TerminalSession.this)); addHandlerRegistration(consoleProcess_.addProcessExitHandler(TerminalSession.this)); addHandlerRegistration(addResizeTerminalHandler(TerminalSession.this)); addHandlerRegistration(addTerminalTitleHandler(TerminalSession.this)); addHandlerRegistration(eventBus_.addHandler(SessionSerializationEvent.TYPE, TerminalSession.this)); if (terminalInputHandler_ == null) terminalInputHandler_ = addTerminalDataInputHandler(TerminalSession.this); consoleProcess.start(new ServerRequestCallback<Void>() { @Override public void onResponseReceived(Void response) { connected_ = true; connecting_ = false; flushQueuedInput(); eventBus_.fireEvent(new TerminalSessionStartedEvent(TerminalSession.this)); } @Override public void onError(ServerError error) { disconnect(); writeError(error.getUserMessage()); } }); } @Override public void onError(ServerError error) { disconnect(); writeError(error.getUserMessage()); } }); }