public CommandShell(TextConsole cons, boolean emu) throws ShellException {
debugEnabled = true;
try {
console = cons;
KeyboardReader in = (KeyboardReader) console.getIn();
ConsoleWriter out = (ConsoleWriter) console.getOut();
ConsoleWriter err = (ConsoleWriter) console.getErr();
if (in == null) {
throw new ShellException("console input stream is null");
}