From ded4138b58283a06196c9a17749b940d9abd936b Mon Sep 17 00:00:00 2001 From: quamrulmina Date: Mon, 12 Oct 2015 22:53:21 -0500 Subject: [PATCH] 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. --- session.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/session.c b/session.c index 9919a1a..afc3898 100644 --- a/session.c +++ b/session.c @@ -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). */