mirror of
https://github.com/tmux/tmux.git
synced 2025-09-02 05:21:10 +00:00
New session selection rules:
- find by name if given - otherwise try current index from $TMUX - otherwise if only one session, use it - otherwise error
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: session.c,v 1.16 2007-09-27 09:15:58 nicm Exp $ */
|
||||
/* $Id: session.c,v 1.17 2007-09-27 09:52:03 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -112,13 +112,13 @@ session_new(struct session *s, const char *cmd, u_int sx, u_int sy)
|
||||
{
|
||||
struct window *w;
|
||||
const char *environ[] = { NULL, "TERM=screen", NULL };
|
||||
char blk[256];
|
||||
char buf[256];
|
||||
u_int i;
|
||||
|
||||
if (session_index(s, &i) != 0)
|
||||
fatalx("session not found");
|
||||
xsnprintf(blk, sizeof blk, "TMUX=%ld,%u", (long) getpid(), i);
|
||||
environ[0] = blk;
|
||||
xsnprintf(buf, sizeof buf, "TMUX=%ld,%u", (long) getpid(), i);
|
||||
environ[0] = buf;
|
||||
|
||||
if ((w = window_create(cmd, environ, sx, sy)) == NULL)
|
||||
return (-1);
|
||||
|
Reference in New Issue
Block a user