summaryrefslogtreecommitdiffstats
path: root/cmd-new-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 /cmd-new-session.c
parent9116905b24ff6ee585f42295b302812aad853ff1 (diff)
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 'cmd-new-session.c')
-rw-r--r--cmd-new-session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/cmd-new-session.c b/cmd-new-session.c
index 6324030f..53800eda 100644
--- a/cmd-new-session.c
+++ b/cmd-new-session.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-new-session.c,v 1.54 2009-08-16 19:07:40 tcunha Exp $ */
+/* $Id: cmd-new-session.c,v 1.55 2009-08-16 19:16:27 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -119,7 +119,7 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
struct termios tio;
const char *update;
char *overrides, *cmd, *cwd, *cause;
- int detached;
+ int detached, idx;
u_int sx, sy;
if (data->newname != NULL && session_find(data->newname) != NULL) {
@@ -217,7 +217,9 @@ cmd_new_session_exec(struct cmd *self, struct cmd_ctx *ctx)
tio.c_ospeed = TTYDEF_SPEED;
/* Create the new session. */
- s = session_create(data->newname, cmd, cwd, &env, &tio, sx, sy, &cause);
+ idx = -1 - options_get_number(&global_s_options, "base-index");
+ s = session_create(
+ data->newname, cmd, cwd, &env, &tio, idx, sx, sy, &cause);
if (s == NULL) {
ctx->error(ctx, "create session failed: %s", cause);
xfree(cause);