diff --git a/bashrc-forward.sh b/bashrc-forward.sh index 8a8f409..4f2ff8d 100644 --- a/bashrc-forward.sh +++ b/bashrc-forward.sh @@ -62,9 +62,11 @@ bashrc_forward () { printf %s ' #-# If bashrc was forwarded using environment variable, unset it, since we do not need it anymore and to keep the env clean. Relaying will set it anyways to something fresh. unset FORWARDED_BASHRC + #-# Set default IFS, since our staging command line may not contain double quotes since they behave weirdly in powershell. + IFS=$(printf '\'' \t\n.'\''); IFS=${IFS%.} _argv_wrap () { if >/dev/null 2>&1 command -v bash; then - bash -c '\'' + exec bash -c '\'' #-# Newest Bash feature used here is parameter transformation (`${_s@A}`), introduced in Bash 4.4 if ! ((BASH_VERSINFO[0]>4||(BASH_VERSINFO[0]==4&&BASH_VERSINFO[1]>=4))) 2>/dev/null; then >&2 echo "Failed to SSH with .bashrc-forwarding, the Bash version is too old."