private void handleEscape(
		final String promptString, // this argument needs to be factored out somehow
		final boolean hideTyping
	) throws 
		IOException 
	{
		byte c = (byte) terminal.read();
		
		// CSI
		if (c == '[') {
			c = (byte) terminal.read();
			switch (c) {
				case 'A': 
					if (historyIterator.hasNext()) {
						b = new StringBuilder(historyIterator.next());
						promptCursor = b.length();
						refreshCurrentPrompt(promptString, hideTyping);
					}
					break;
					
				case 'B':  
					if (historyIterator.hasPrevious()) {
						b = new StringBuilder(historyIterator.previous());
						promptCursor = b.length();
						refreshCurrentPrompt(promptString, hideTyping);
					}
					break;
				
				case 'C': 
					if (promptCursor < b.length()) {
						promptCursor++;
						terminal.cursorRight();
					}
					break;
					
				case 'D': 
					if (promptCursor > 0) {
						promptCursor--;
						terminal.cursorLeft();
					}
					break;
			}
		} else {
			return;
		}
	}