shell = ((ServerSession) session).getServerFactoryManager().getShellFactory().createShell();
// If the shell wants to be aware of the session, let's do that
if (shell instanceof ShellFactory.SessionAware) {
((ShellFactory.SessionAware) shell).setSession((ServerSession) session);
}
out = new ChannelOutputStream(this, remoteWindow, log, SshConstants.Message.SSH_MSG_CHANNEL_DATA);
err = new ChannelOutputStream(this, remoteWindow, log, SshConstants.Message.SSH_MSG_CHANNEL_EXTENDED_DATA);
// Wrap in logging filters
out = new LoggingFilterOutputStream(out, "OUT:", log);
err = new LoggingFilterOutputStream(err, "ERR:", log);
if (getPtyModeValue(PtyMode.ONLCR) != 0) {
out = new LfToCrLfFilterOutputStream(out);