prompt = getDefaultSecondaryPrompt(); reader.getCursorBuffer().cursor = 0; reader.getCursorBuffer().write(removeBackslash(line) + LINE_SEPARATOR);
/** * Write out the specified string to the buffer and the output stream. */ public void putString(final CharSequence str) throws IOException { int pos = getCursorPosition(); buf.write(str); if (mask == null) { // no masking fmtPrint(str, pos); } else if (mask == NULL_MASK) { // don't print anything } else { rawPrint(mask, str.length()); } drawBuffer(); }
/** * Possible states in which the current readline operation may be in. */ private static enum State { /** * The user is just typing away */ NORMAL, /** * In the middle of a emacs seach */ SEARCH, FORWARD_SEARCH, /** * VI "yank-to" operation ("y" during move mode) */ VI_YANK_TO, /** * VI "delete-to" operation ("d" during move mode) */ VI_DELETE_TO, /** * VI "change-to" operation ("c" during move mode) */ VI_CHANGE_TO }
/** * Write out the specified string to the buffer and the output stream. */ public void putString(final CharSequence str) throws IOException { int pos = getCursorPosition(); buf.write(str); if (mask == null) { // no masking fmtPrint(str, pos); } else if (mask == NULL_MASK) { // don't print anything } else { rawPrint(mask, str.length()); } drawBuffer(); }
@Override public void actionPerformed(ActionEvent e) { CursorBuffer buf = textTerminal.reader.getCursorBuffer(); String partialInput = buf.buffer.toString(); buf.clear(); ReadHandlerData handlerData = handler.apply(textTerminal); ReadInterruptionStrategy.Action action = handlerData.getAction(); if(action == CONTINUE) { buf.write(partialInput); } else { if(action == RESTART) { textTerminal.initialReadBuffer = partialInput; } ReadInterruptionData interruptData = ReadInterruptionData.from(handlerData, partialInput); throw new ReadInterruptionException(interruptData, partialInput); } } }
/** * Possible states in which the current readline operation may be in. */ private static enum State { /** * The user is just typing away */ NORMAL, /** * In the middle of a emacs seach */ SEARCH, FORWARD_SEARCH, /** * VI "yank-to" operation ("y" during move mode) */ VI_YANK_TO, /** * VI "delete-to" operation ("d" during move mode) */ VI_DELETE_TO, /** * VI "change-to" operation ("c" during move mode) */ VI_CHANGE_TO }
prompt = getDefaultSecondaryPrompt(); reader.getCursorBuffer().cursor = 0; reader.getCursorBuffer().write(removeBackslash(line) + LINE_SEPARATOR);
reader.getCursorBuffer().write(buffer.toString()); reader.getCursorBuffer().cursor = cursor;