Skip to content

Commit b72c36c

Browse files
committed
Fix USERNAME env variable not set correctly
USERNAME environment variable is set correctly with the remote logged on username.
1 parent 5c3dc05 commit b72c36c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

session.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ do_exec_no_pty(Session *s, const char *command)
591591
si.lpDesktop = L"winsta0\\default";
592592

593593
SetEnvironmentVariable("USER", s->pw->pw_name);
594+
SetEnvironmentVariable("USERNAME", s->pw->pw_name);
594595
SetEnvironmentVariable("LOGNAME", s->pw->pw_name);
595596

596597
/*
@@ -1206,7 +1207,7 @@ do_exec_pty(Session *s, const char *command)
12061207
*/
12071208

12081209
//return 0;
1209-
return do_exec_pty(s, command);
1210+
return do_exec_no_pty(s, command);
12101211

12111212
#endif
12121213
}

0 commit comments

Comments
 (0)