use of org.jboss.as.cli.impl.ReadlineConsole.Settings in project wildfly-core by wildfly.
the class CommandContextImpl method initBasicConsole.
protected void initBasicConsole(InputStream consoleInput, boolean start) throws CliInitializationException {
// this method shouldn't be called twice during the session
assert console == null : "the console has already been initialized";
Settings settings = createSettings(consoleInput);
try {
this.console = new ReadlineConsole(settings);
} catch (IOException ex) {
throw new CliInitializationException(ex);
}
this.console.setActionCallback((line) -> {
handleSafe(line.trim());
if (console != null) {
console.setPrompt(getPrompt());
}
});
if (start) {
try {
console.start();
} catch (IOException ex) {
throw new CliInitializationException(ex);
}
}
}
Aggregations