aboutsummaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-08-16 18:59:12 +0000
committerTiago Cunha <tcunha@gmx.com>2009-08-16 18:59:12 +0000
commitf415d43c3b5cb6f519b171949a6a3eeaacbf6540 (patch)
treef591d6ce7494850f85da15e78c4d0b03525465cb /session.c
parent8f9858ba2f2fa410b8e0c20a7763517b6610fcb0 (diff)
downloadrtmux-f415d43c3b5cb6f519b171949a6a3eeaacbf6540.tar.gz
rtmux-f415d43c3b5cb6f519b171949a6a3eeaacbf6540.tar.bz2
rtmux-f415d43c3b5cb6f519b171949a6a3eeaacbf6540.zip
Sync OpenBSD patchset 254:
When creating a new session from the command-line where there is an external terminal, copy the termios(4) special characters and use them for new windows created in the new session. Suggested by Theo.
Diffstat (limited to 'session.c')
-rw-r--r--session.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/session.c b/session.c
index 7b9bf26a..b27c94b8 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $Id: session.c,v 1.60 2009-08-09 17:48:55 tcunha Exp $ */
+/* $Id: session.c,v 1.61 2009-08-16 18:59:12 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -113,7 +113,7 @@ session_find(const char *name)
/* Create a new session. */
struct session *
session_create(const char *name, const char *cmd, const char *cwd,
- struct environ *env, u_int sx, u_int sy, char **cause)
+ struct environ *env, struct termios *tio, u_int sx, u_int sy, char **cause)
{
struct session *s;
u_int i;
@@ -131,6 +131,7 @@ session_create(const char *name, const char *cmd, const char *cwd,
environ_init(&s->environ);
if (env != NULL)
environ_copy(env, &s->environ);
+ memcpy(&s->tio, tio, sizeof s->tio);
s->sx = sx;
s->sy = sy;
@@ -200,7 +201,7 @@ session_index(struct session *s, u_int *i)
/* Create a new window on a session. */
struct winlink *
-session_new(struct session *s,
+session_new(struct session *s,
const char *name, const char *cmd, const char *cwd, int idx, char **cause)
{
struct window *w;
@@ -213,7 +214,8 @@ session_new(struct session *s,
server_fill_environ(s, &env);
hlimit = options_get_number(&s->options, "history-limit");
- w = window_create(name, cmd, cwd, &env, s->sx, s->sy, hlimit, cause);
+ w = window_create(
+ name, cmd, cwd, &env, &s->tio, s->sx, s->sy, hlimit, cause);
if (w == NULL) {
environ_free(&env);
return (NULL);