From 22990a6595fdff840010aa6df9a60ada61331b5e Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 27 Sep 2007 09:52:03 +0000 Subject: New session selection rules: - find by name if given - otherwise try current index from $TMUX - otherwise if only one session, use it - otherwise error --- session.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index 9350694c..d15af07c 100644 --- a/session.c +++ b/session.c @@ -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 @@ -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); -- cgit