@Override public void horizontalTab() { if (myCursorX >= myTerminalWidth) { return; } int length = myTerminalTextBuffer.getLine(myCursorY - 1).getText().length(); int stop = myTabulator.nextTab(myCursorX); myCursorX = Math.max(myCursorX, length); if (myCursorX < stop) { char[] chars = new char[stop - myCursorX]; Arrays.fill(chars, CharUtils.EMPTY_CHAR); doWriteString(new String(chars)); } else { myCursorX = stop; } myDisplay.setCursor(myCursorX, myCursorY); }