version 1.57, 2015/10/28 09:51:55 |
version 1.58, 2015/10/31 08:13:58 |
|
|
/* Create a new session. */ |
/* Create a new session. */ |
struct session * |
struct session * |
session_create(const char *name, int argc, char **argv, const char *path, |
session_create(const char *name, int argc, char **argv, const char *path, |
int cwd, struct environ *env, struct termios *tio, int idx, u_int sx, |
const char *cwd, struct environ *env, struct termios *tio, int idx, |
u_int sy, char **cause) |
u_int sx, u_int sy, char **cause) |
{ |
{ |
struct session *s; |
struct session *s; |
struct winlink *wl; |
struct winlink *wl; |
|
|
s->references = 1; |
s->references = 1; |
s->flags = 0; |
s->flags = 0; |
|
|
s->cwd = dup(cwd); |
s->cwd = xstrdup(cwd); |
|
|
s->curw = NULL; |
s->curw = NULL; |
TAILQ_INIT(&s->lastw); |
TAILQ_INIT(&s->lastw); |
|
|
winlink_remove(&s->windows, wl); |
winlink_remove(&s->windows, wl); |
} |
} |
|
|
close(s->cwd); |
free((void *)s->cwd); |
|
|
session_unref(s); |
session_unref(s); |
} |
} |
|
|
/* Create a new window on a session. */ |
/* Create a new window on a session. */ |
struct winlink * |
struct winlink * |
session_new(struct session *s, const char *name, int argc, char **argv, |
session_new(struct session *s, const char *name, int argc, char **argv, |
const char *path, int cwd, int idx, char **cause) |
const char *path, const char *cwd, int idx, char **cause) |
{ |
{ |
struct window *w; |
struct window *w; |
struct winlink *wl; |
struct winlink *wl; |