diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-13 19:03:59 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-13 19:03:59 +0000 |
commit | 52793e7a3fc7f53b173ee887c221ff4ed38499e8 (patch) | |
tree | 356d4c56edbc1c2e4ed9d567c682dafc30290808 /session.c | |
parent | 2e3bb5a51193269305eca3d689b6c66d08b2530a (diff) |
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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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); |