diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -113,8 +113,8 @@ session_find_by_id(u_int id) /* Create a new session. */ struct session * session_create(const char *prefix, const char *name, int argc, char **argv, - const char *path, const char *cwd, struct environ *env, struct termios *tio, - int idx, u_int sx, u_int sy, char **cause) + const char *path, const char *cwd, struct environ *env, struct options *oo, + struct termios *tio, int idx, char **cause) { struct session *s; struct winlink *wl; @@ -133,7 +133,7 @@ session_create(const char *prefix, const char *name, int argc, char **argv, if (env != NULL) environ_copy(env, s->environ); - s->options = options_create(global_s_options); + s->options = oo; s->hooks = hooks_create(global_hooks); status_update_saved(s); @@ -144,9 +144,6 @@ session_create(const char *prefix, const char *name, int argc, char **argv, memcpy(s->tio, tio, sizeof *s->tio); } - s->sx = sx; - s->sy = sy; - if (name != NULL) { s->name = xstrdup(name); s->id = next_session_id++; @@ -350,7 +347,7 @@ session_new(struct session *s, const char *name, int argc, char **argv, struct winlink *wl; struct environ *env; const char *shell; - u_int hlimit; + u_int hlimit, sx, sy; if ((wl = winlink_add(&s->windows, idx)) == NULL) { xasprintf(cause, "index in use: %d", idx); @@ -362,10 +359,11 @@ session_new(struct session *s, const char *name, int argc, char **argv, if (*shell == '\0' || areshell(shell)) shell = _PATH_BSHELL; + default_window_size(s, NULL, &sx, &sy, -1); hlimit = options_get_number(s->options, "history-limit"); env = environ_for_session(s, 0); w = window_create_spawn(name, argc, argv, path, shell, cwd, env, s->tio, - s->sx, s->sy, hlimit, cause); + sx, sy, hlimit, cause); if (w == NULL) { winlink_remove(&s->windows, wl); environ_free(env); @@ -548,6 +546,7 @@ session_set_current(struct session *s, struct winlink *wl) s->curw = wl; winlink_clear_flags(wl); window_update_activity(wl->window); + tty_update_window_offset(wl->window); notify_session("session-window-changed", s); return (0); } |