sshd server puts remote user@target in the console prompt

Usability improvement fix ( issue #6 ). sshd.exe puts remote user and
host info on the console prompt. user@target $P$G is set as cmd.exe
PROMPT via environment variable.
This commit is contained in:
quamrulmina 2015-10-12 22:53:21 -05:00
parent 9fa909e3df
commit ded4138b58
1 changed files with 6 additions and 0 deletions

View File

@ -762,6 +762,12 @@ do_exec_no_pty(Session *s, const char *command)
SetEnvironmentVariable("SSH_CONNECTION", buf);
// set better prompt for Windows cmd shell
if (!s -> is_subsystem) {
snprintf(buf,sizeof buf, "%s@%s $P$G", s->pw->pw_name, getenv("COMPUTERNAME"));
SetEnvironmentVariable("PROMPT", buf);
}
/*
* Get the current user's name (associated with sshd thread).
*/