session.send("prompt", session.shell.getPrompt());
} else if (type.getAsString().equals("execute")) {
String command = event.get("command").getAsString();
int width = event.get("width").getAsInt();
int height = event.get("height").getAsInt();
ShellProcess process = session.shell.createProcess(command);
WSProcessContext context = new WSProcessContext(session, process, command, width, height);
if (session.current.getAndSet(context) == null) {
log.fine("Executing \"" + command + "\"");
process.execute(context);
} else {
log.fine("Could not execute \"" + command + "\"");
}
} else if (type.getAsString().equals("cancel")) {
WSProcessContext current = session.current.getAndSet(null);