private void abort() throws IOException { beep(); buf.clear(); println(); redrawLine(); }
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { if (rand.nextInt(10) == 0) { shellState.getReader().beep(); shellState.getReader().println(); shellState.getReader() .println(new String(Base64.getDecoder() .decode("ICAgICAgIC4tLS4KICAgICAgLyAvXCBcCiAgICAgKCAvLS1cICkKICAgICAuPl8g" + "IF88LgogICAgLyB8ICd8ICcgXAogICAvICB8Xy58Xy4gIFwKICAvIC98ICAgIC" + "AgfFwgXAogfCB8IHwgfFwvfCB8IHwgfAogfF98IHwgfCAgfCB8IHxffAogICAg" + "IC8gIF9fICBcCiAgICAvICAvICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvIC" + "AvICAgICAgXCB8IHwKIHxfXy8gICAgICAgIFx8X3wK"), UTF_8)); } else { throw new ShellCommandException(ErrorCode.UNRECOGNIZED_COMMAND, getName()); } return 0; }
} catch(IllegalArgumentException e) { Log.error("Could not expand event", e); beep(); buf.clear(); str = "";
reader.beep();
c.beep(); c.println(); c.println();
/** * 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 }
private void abort() throws IOException { beep(); buf.clear(); println(); redrawLine(); }
this.reader.beep(); while (this.isReading && (inputLine = this.reader.readLine("> ")) != null) {
} catch(IllegalArgumentException e) { Log.error("Could not expand event", e); beep(); buf.clear(); str = "";
@Override public int execute(final String fullCommand, final CommandLine cl, final Shell shellState) throws Exception { if (rand.nextInt(10) == 0) { shellState.getReader().beep(); shellState.getReader().println(); shellState.getReader() .println(new String(Base64 .decodeBase64(("ICAgICAgIC4tLS4KICAgICAgLyAvXCBcCiAgICAgKCAvLS1cICkKICAgICAuPl8gIF88" + "LgogICAgLyB8ICd8ICcgXAogICAvICB8Xy58Xy4gIFwKICAvIC98ICAgICAgfFwgXAog" + "fCB8IHwgfFwvfCB8IHwgfAogfF98IHwgfCAgfCB8IHxffAogICAgIC8gIF9fICBcCiAg" + "ICAvICAvICBcICBcCiAgIC8gIC8gICAgXCAgXF8KIHwvICAvICAgICAgXCB8IHwKIHxf" + "Xy8gICAgICAgIFx8X3wK").getBytes(UTF_8)), UTF_8)); } else { throw new ShellCommandException(ErrorCode.UNRECOGNIZED_COMMAND, getName()); } return 0; }
c.beep(); c.println(); c.println();
/** * 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 }
/** * Prints out the candidates. If the size of the candidates is greater than the * {@link ConsoleReader#getAutoprintThreshold}, a warning is printed * * @param candidates the list of candidates to print */ protected void printCandidates(final ConsoleReader reader, List<CharSequence> candidates) throws IOException { Set<CharSequence> distinctCandidates = new HashSet<CharSequence>(candidates); if (distinctCandidates.size() > reader.getAutoprintThreshold()) { reader.println(); reader.print(Messages.DISPLAY_CANDIDATES.format(candidates.size())); reader.flush(); char[] allowed = {'y', 'n'}; int c; while ((c = reader.readCharacter(allowed)) != -1) { if (c=='n') { reader.println(); return; } if (c=='y') { break; } reader.beep(); } } reader.println(); reader.printColumns(sortCandidates(distinctCandidates)); }