aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-16 19:16:27 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-16 19:16:27 +0000
commite61ee94e26a82479b5de2ed4c1686625ea5d078d (patch)
treeb30a1f1c63e3cf956c73ec161d90999e7953b187 /session.c
parent9116905b24ff6ee585f42295b302812aad853ff1 (diff)
downloadrtmux-e61ee94e26a82479b5de2ed4c1686625ea5d078d.tar.gz
rtmux-e61ee94e26a82479b5de2ed4c1686625ea5d078d.tar.bz2
rtmux-e61ee94e26a82479b5de2ed4c1686625ea5d078d.zip
Sync OpenBSD patchset 257:
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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/session.c b/session.c
index b27c94b8..eedee301 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $Id: session.c,v 1.61 2009-08-16 18:59:12 tcunha Exp $ */
+/* $Id: session.c,v 1.62 2009-08-16 19:16:27 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);