=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh.c,v retrieving revision 1.557 retrieving revision 1.558 diff -u -r1.557 -r1.558 --- src/usr.bin/ssh/ssh.c 2021/05/19 01:24:05 1.557 +++ src/usr.bin/ssh/ssh.c 2021/06/04 05:02:40 1.558 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.557 2021/05/19 01:24:05 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.558 2021/06/04 05:02:40 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1997,7 +1997,7 @@ ssh_session2_setup(struct ssh *ssh, int id, int success, void *arg) { extern char **environ; - const char *display; + const char *display, *term; int r, interactive = tty_flag; char *proto = NULL, *data = NULL; @@ -2032,7 +2032,10 @@ ssh_packet_set_interactive(ssh, interactive, options.ip_qos_interactive, options.ip_qos_bulk); - client_session2_setup(ssh, id, tty_flag, subsystem_flag, getenv("TERM"), + if ((term = lookup_env_in_list("TERM", options.setenv, + options.num_setenv)) == NULL || *term == '\0') + term = getenv("TERM"); + client_session2_setup(ssh, id, tty_flag, subsystem_flag, term, NULL, fileno(stdin), command, environ); }