From f1573d922d9454088842f074e70588550bd6537a Mon Sep 17 00:00:00 2001 From: cubernetes Date: Fri, 23 Oct 2026 17:39:36 +0200 Subject: [PATCH] Exec bash and reset IFS to default --- bashrc-forward.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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."