diff --git a/session.c b/session.c index c821dcd4462d..29768f7de79b 100644 --- a/session.c +++ b/session.c @@ -1063,6 +1063,8 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) child_set_env(&env, &envsize, "TZ", getenv("TZ")); if (s->term) child_set_env(&env, &envsize, "TERM", s->term); + if (s->colorterm) + child_set_env(&env, &envsize, "COLORTERM", s->colorterm); if (s->display) child_set_env(&env, &envsize, "DISPLAY", s->display); @@ -2448,6 +2450,7 @@ session_close(struct ssh *ssh, Session *s) if (s->ttyfd != -1) session_pty_cleanup(s); free(s->term); + free(s->colorterm); free(s->display); free(s->x11_chanids); free(s->auth_display); diff --git a/session.h b/session.h index 344a1ddf9d54..524836b203f8 100644 --- a/session.h +++ b/session.h @@ -38,7 +38,7 @@ struct Session { int forced; /* tty */ - char *term; + char *term, *colorterm; int ptyfd, ttyfd, ptymaster; u_int row, col, xpixel, ypixel; char tty[TTYSZ]; diff --git a/sshd_config.5 b/sshd_config.5 index a0f16874f065..8ef4ac8de14e 100644 --- a/sshd_config.5 +++ b/sshd_config.5 @@ -1528,7 +1528,7 @@ Valid options are .Cm no or a pattern-list specifying which environment variable names to accept (for example -.Qq LANG,LC_* ) . +.Qq COLORTERM,LANG,LC_* ) . The default is .Cm no . Enabling environment processing may enable users to bypass access