mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 06:17:04 +00:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user