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.
This commit is contained in:
Nicholas Marriott
2009-08-13 19:03:59 +00:00
parent 2e3bb5a511
commit 52793e7a3f
7 changed files with 49 additions and 16 deletions

View File

@ -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);