final ShellManager sm = InitialNaming.lookup(ShellManager.NAME);
final ConsoleManager conMgr = sm.getCurrentShell().getConsole().getManager();
final PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
TextConsole console = createConsoleWithShell(conMgr, out);
System.setIn(new ReaderInputStream(console.getIn()));
System.setOut(new PrintStream(new WriterOutputStream(console.getOut(), false), true));
System.setErr(new PrintStream(new WriterOutputStream(console.getErr(), false), true));
} catch (Exception ex) {
// FIXME
System.out.println("Problem creating the isolated console");
ex.printStackTrace(System.err);
}