Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import org.jboss.aesh.console.AeshConsoleCallback;
import org.jboss.aesh.console.Console;
import org.jboss.aesh.console.ConsoleCallback;
import org.jboss.aesh.console.ConsoleOperation;
import org.jboss.aesh.console.Prompt;
import org.jboss.aesh.console.settings.SettingsBuilder;
public class ConsoleExample {
public static void main(String... args) {
final Console console = new Console(new SettingsBuilder().create());
final ConsoleCallback consoleCallback = new AeshConsoleCallback() {
public int execute(ConsoleOperation operation) throws InterruptedException {
console.getShell().out().println("======>\"" + operation.getBuffer());
if (operation.getBuffer().equals("quit") || operation.getBuffer().equals("exit"))
return 0;
console.setPrompt(new Prompt("aesh@rules: "));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment