better support for Win10 OpenSSH server (#1375)
If msys2 bash is set as the DefaultShell for the Win10 OpenSSH server, there is no way to pass -l to make it a login shell, so /etc/profile is not sourced, PATH is not set, and the bashrc produces errors. Detect this case in /etc/bash.bashrc, by checking for the SSH_CONNECTION environment variable and PATH not having msys2 elements, and source /etc/profile.
This commit is contained in:
@@ -15,6 +15,11 @@
|
||||
# If not running interactively, don't do anything
|
||||
[[ "$-" != *i* ]] && return
|
||||
|
||||
# If started from sshd, make sure profile is sourced
|
||||
if [[ -n "$SSH_CONNECTION" ]] && [[ "$PATH" != *:/usr/bin* ]]; then
|
||||
source /etc/profile
|
||||
fi
|
||||
|
||||
# Warnings
|
||||
unset _warning_found
|
||||
for _warning_prefix in '' ${MINGW_PREFIX}; do
|
||||
|
||||
Reference in New Issue
Block a user