Porting shell_session.