/** * Creates the REPL's console. * @param commandLine The command line options. */ private Console createConsole(CommandLine commandLine) { // console settings boolean useAnsi = !commandLine.hasOption("na"); SettingsBuilder settings = new SettingsBuilder().enableAlias(true) .enableMan(true) .ansi(useAnsi) .parseOperators(false) .inputStream(PausableInput.INSTANCE); if(commandLine.hasOption("irc")) { settings = settings.inputrc(new File(commandLine.getOptionValue("irc"))); } return new Console(settings.create()); }
.outputStream(System.out).outputStreamError(System.err).ansi(false).create(); this.shell = shellFactory.createShell(OperatingSystemUtils.getWorkingDir(), settings); Settings settings = new SettingsBuilder().create(); ShellInitializer.this.shell = shellFactory.createShell(OperatingSystemUtils.getWorkingDir(), settings); });
.enableExport(false) .inputStream(Globals.stdin) .create();
.enableExport(false) .inputStream(Globals.stdin) .create();
@Override public Settings buildAeshSettings() { try { inputStream = new PipedInputStream(stdin); settings = new SettingsBuilder() .inputStream(inputStream) .outputStream(stdout) .outputStreamError(stderr) .name("test") .logging(true) .terminal(new TestTerminal()) .create(); settings.getOperationManager().addOperation(new KeyOperation(Key.ENTER, Operation.NEW_LINE)); } catch (IOException e) { throw new RuntimeException("Could not configure Shell.", e); } return settings; }
.outputStream(stdout) .outputStreamError(stderr) .create(); try (Shell scriptShell = shellFactory.createShell(currentResource, settings))
this.console = new AeshConsoleBuilder() .prompt(createPrompt(initialResource)) .settings(newSettings.create()) .commandRegistry(registry) .commandNotFoundHandler(new ForgeCommandNotFoundHandler(this, commandNotFoundListeners))
.commandRegistry(registry) .settings(settingsBuilder.create()) .create();
@Override public void initialize(ShellHandleSettings settings) { SettingsBuilder settingsBuilder = new SettingsBuilder() .inputStream(settings.stdIn()) .outputStream(settings.stdOut()) .outputStreamError(settings.stdErr()) .enableMan(true); if (settings.terminal() != null) { settingsBuilder.terminal(new ForgeTerminal(settings.terminal())); } this.shell = shellFactory.createShell(settings.currentResource(), settingsBuilder.create()); ShellImpl shellImpl = (ShellImpl) shell; if (settings.name() != null) { shellImpl.setName(settings.name()); } if (settings.desktop() != null) { shellImpl.setDesktop(settings.desktop()); } // this will always be embedded shellImpl.setEmbedded(true); }