/** * 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()); }
Settings settings = new SettingsBuilder().inputStream(new ByteArrayInputStream(command.getBytes())) .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); });
Settings settings = new SettingsBuilder() .logging(false) .readInputrc(false)
Settings settings = new SettingsBuilder() .logging(false) .readInputrc(false)
@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; }
public void run() { final Settings consoleSettings = new SettingsBuilder() .outputStream(this.out) .inputStream(this.in)
try Settings settings = new SettingsBuilder() .inputStream(new PipedInputStream(stdin)) .outputStream(stdout)
SettingsBuilder newSettings = new SettingsBuilder(settings) .historyFile(history) .aliasFile(alias)
SettingsBuilder settingsBuilder = new SettingsBuilder(); settingsBuilder.readInputrc(false); settingsBuilder.logging(true);
@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); }