From 52793e7a3fc7f53b173ee887c221ff4ed38499e8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 13 Aug 2009 19:03:59 +0000 Subject: 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. --- session.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index f53e14da..9b7beeb5 100644 --- a/session.c +++ b/session.c @@ -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); -- cgit