@Override
		public void keyPressed(KeyEvent e) {
			CodeCompletionWindow completionWindow = getCodeCompletionWindow();

			switch (e.getKeyCode()) {
				case KeyEvent.VK_ENTER:
					if (completionWindow.isVisible()) {
						/* As opposed to TAB, ENTER inserts the selected
						 * completion (if there is one selected) then
						 * *closes* the completionWindow
						 */
						insertCompletion(completionWindow.getCompletion());
						completionWindow.setVisible(false);
						e.consume();
					}
					else {
						inputTextPane.setCaretPosition(inputTextPane.getDocument().getLength());
					}
					break;
				case KeyEvent.VK_UP:
					if (completionWindow.isVisible()) {
						/* scroll up in the completion window */
						completionWindow.selectPrevious();
					}
					else {
						String historyUp = history.getHistoryUp();
						if (historyUp != null) {
							setInputTextPaneText(historyUp);
						}
					}
					e.consume();
					break;
				case KeyEvent.VK_DOWN:
					if (completionWindow.isVisible()) {
						/* scroll down in the completion window */
						completionWindow.selectNext();
					}
					else {
						String historyDown = history.getHistoryDown();
						if (historyDown != null) {
							setInputTextPaneText(historyDown);
						}
					}
					e.consume();
					break;
				case KeyEvent.VK_ESCAPE:
					completionWindow.setVisible(false);
					e.consume();
					break;
				default:

					// Check for the completion window trigger on input that contains text
					if (completionWindowTrigger.isTrigger(e) &&
						!inputTextPane.getText().trim().isEmpty()) {
						completionWindowTriggered(completionWindow);
						e.consume();
						break;
					}

					updateCompletionList();
					// and let the key go through to the text input field
			}
		}
Resets this stream from a closed/always-eof state to an open state.
<p>
Also clears any queued bytes.  Safe to call even when open.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/interpreter/InterpreterPanel.java