- inst->back = &pty_backend;
- inst->back->init((void *)inst->term, &inst->backhandle, &inst->cfg,
- NULL, 0, NULL, 0);
+ inst->back = select_backend(&inst->cfg);
+ {
+ char *realhost;
+
+ inst->back->init((void *)inst->term, &inst->backhandle, &inst->cfg,
+ inst->cfg.host, inst->cfg.port, &realhost,
+ inst->cfg.tcp_nodelay);
+
+ if (inst->cfg.wintitle[0])
+ set_title(inst, inst->cfg.wintitle);
+ else {
+ char *title = make_default_wintitle(realhost);
+ set_title(inst, title);
+ sfree(title);
+ }
+ }