Skip to content

Commit ded4138

Browse files
committed
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.
1 parent 9fa909e commit ded4138

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

session.c

+6
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,12 @@ do_exec_no_pty(Session *s, const char *command)
762762

763763
SetEnvironmentVariable("SSH_CONNECTION", buf);
764764

765+
// set better prompt for Windows cmd shell
766+
if (!s -> is_subsystem) {
767+
snprintf(buf,sizeof buf, "%s@%s $P$G", s->pw->pw_name, getenv("COMPUTERNAME"));
768+
SetEnvironmentVariable("PROMPT", buf);
769+
}
770+
765771
/*
766772
* Get the current user's name (associated with sshd thread).
767773
*/

0 commit comments

Comments
 (0)