shellThread.addInputString(cmd);
shellThread.waitUntilReady();
if (shellThread.isDone()) {
// the command was exit, invalidate session
userShells.remove(session.getId());
session.invalidate();
return;
}
// get the shell's output
StringBuilder sb = new StringBuilder();
sb.append(shellThread.getOutput().replace("<", "<").replace(">", ">"));