summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/session.c b/session.c
index 2075abe5..a1c8ddae 100644
--- a/session.c
+++ b/session.c
@@ -112,8 +112,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;
@@ -132,7 +132,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);
@@ -143,9 +143,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++;
@@ -349,7 +346,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);
@@ -361,10 +358,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);
@@ -547,6 +545,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);
}