+- (void)notifyRemoteExit
+{
+ int exitcode;
+
+ if (!exited && (exitcode = back->exitcode(backhandle)) >= 0)
+ [self endSession:(exitcode == 0)];
+}
+
+- (void)endSession:(int)clean
+{
+ exited = TRUE;
+ if (ldisc) {
+ ldisc_free(ldisc);
+ ldisc = NULL;
+ }
+ if (back) {
+ back->free(backhandle);
+ backhandle = NULL;
+ back = NULL;
+ //FIXME: update specials menu;
+ }
+ if (cfg.close_on_exit == FORCE_ON ||
+ (cfg.close_on_exit == AUTO && clean))
+ [self close];
+ // FIXME: else show restart menu item
+}
+
+- (Terminal *)term
+{
+ return term;
+}
+