diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-13 20:11:58 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-13 20:11:58 +0000 |
commit | 3ad4de6c8cbdc767c6ac40b99764cc7bd8db066a (patch) | |
tree | 542f3ff53b0bc779bf29cb1ca1483e3636a86255 /session.c | |
parent | 3026118c702fc0f17b860197b5242816927bbadb (diff) | |
download | rtmux-3ad4de6c8cbdc767c6ac40b99764cc7bd8db066a.tar.gz rtmux-3ad4de6c8cbdc767c6ac40b99764cc7bd8db066a.tar.bz2 rtmux-3ad4de6c8cbdc767c6ac40b99764cc7bd8db066a.zip |
Add a base-index session option to specify the first index checked when looking
for an index for a new window.
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -113,7 +113,8 @@ session_find(const char *name) /* Create a new session. */ struct session * session_create(const char *name, const char *cmd, const char *cwd, - struct environ *env, struct termios *tio, u_int sx, u_int sy, char **cause) + struct environ *env, struct termios *tio, int idx, u_int sx, u_int sy, + char **cause) { struct session *s; u_int i; @@ -149,11 +150,11 @@ session_create(const char *name, const char *cmd, const char *cwd, s->name = xstrdup(name); else xasprintf(&s->name, "%u", i); - if (session_new(s, NULL, cmd, cwd, -1, cause) == NULL) { + if (session_new(s, NULL, cmd, cwd, idx, cause) == NULL) { session_destroy(s); return (NULL); } - session_select(s, 0); + session_select(s, RB_ROOT(&s->windows)->idx); log_debug("session %s created", s->name); |