From b72c36c802939cd7b088e070ae6adb63d7f4d277 Mon Sep 17 00:00:00 2001 From: quamrulmina Date: Sun, 11 Oct 2015 02:38:44 -0500 Subject: [PATCH] Fix USERNAME env variable not set correctly USERNAME environment variable is set correctly with the remote logged on username. --- session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/session.c b/session.c index 730e253..f02631e 100644 --- a/session.c +++ b/session.c @@ -591,6 +591,7 @@ do_exec_no_pty(Session *s, const char *command) si.lpDesktop = L"winsta0\\default"; SetEnvironmentVariable("USER", s->pw->pw_name); + SetEnvironmentVariable("USERNAME", s->pw->pw_name); SetEnvironmentVariable("LOGNAME", s->pw->pw_name); /* @@ -1206,7 +1207,7 @@ do_exec_pty(Session *s, const char *command) */ //return 0; - return do_exec_pty(s, command); + return do_exec_no_pty(s, command); #endif }