+ char *realhost;
+ const char *error;
+
+ inst->back = select_backend(&inst->cfg);
+
+ error = inst->back->init((void *)inst, &inst->backhandle,
+ &inst->cfg, inst->cfg.host, inst->cfg.port,
+ &realhost, inst->cfg.tcp_nodelay,
+ inst->cfg.tcp_keepalives);
+
+ if (error) {
+ char *msg = dupprintf("Unable to open connection to %s:\n%s",
+ inst->cfg.host, error);
+ inst->exited = TRUE;
+ fatal_message_box(inst->window, msg);
+ sfree(msg);
+ exit(0);
+ }
+
+ if (inst->cfg.wintitle[0]) {
+ set_title(inst, inst->cfg.wintitle);
+ set_icon(inst, inst->cfg.wintitle);
+ } else {
+ char *title = make_default_wintitle(realhost);
+ set_title(inst, title);
+ set_icon(inst, title);
+ sfree(title);
+ }
+ inst->back->provide_logctx(inst->backhandle, inst->logctx);
+
+ term_provide_resize_fn(inst->term, inst->back->size, inst->backhandle);
+
+ inst->ldisc =
+ ldisc_create(&inst->cfg, inst->term, inst->back, inst->backhandle,
+ inst);
+
+ gtk_widget_hide(inst->restartitem);
+}
+
+int pt_main(int argc, char **argv)
+{