summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-03 21:42:37 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-03 21:42:37 +0000
commit9e6090a7a2a0d25499bce0dc68fd67289f3a5e39 (patch)
treefd99a49a5ae948c9a1eb618cae7fd26e68d554a4 /session.c
parent85d520c41e74056e59f11b5d1f6dd3f5602fa17a (diff)
Per-session configuration options.
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/session.c b/session.c
index 4bc52b75..0748c117 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $Id: session.c,v 1.32 2008-06-03 18:13:54 nicm Exp $ */
+/* $Id: session.c,v 1.33 2008-06-03 21:42:37 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -95,7 +95,8 @@ session_create(const char *name, const char *cmd, u_int sx, u_int sy)
s->curw = s->lastw = NULL;
RB_INIT(&s->windows);
ARRAY_INIT(&s->bells);
-
+ options_init(&s->options, &global_options);
+
s->sx = sx;
s->sy = sy;
@@ -137,6 +138,8 @@ session_destroy(struct session *s)
while (!ARRAY_EMPTY(&sessions) && ARRAY_LAST(&sessions) == NULL)
ARRAY_TRUNC(&sessions, 1);
+ options_free(&s->options);
+
while (!RB_EMPTY(&s->windows))
winlink_remove(&s->windows, RB_ROOT(&s->windows));
@@ -162,14 +165,15 @@ session_new(struct session *s, const char *name, const char *cmd, int idx)
struct window *w;
const char *env[] = { NULL, "TERM=screen", NULL };
char buf[256];
- u_int i;
+ u_int i, hlimit;
if (session_index(s, &i) != 0)
fatalx("session not found");
xsnprintf(buf, sizeof buf, "TMUX=%ld,%u", (long) getpid(), i);
env[0] = buf;
- if ((w = window_create(name, cmd, env, s->sx, s->sy)) == NULL)
+ hlimit = options_get_number(&s->options, "history-limit");
+ if ((w = window_create(name, cmd, env, s->sx, s->sy, hlimit)) == NULL)
return (NULL);
return (session_attach(s, w, idx));
}