Skip to content

Commit 3dd1cc2

Browse files
committed
Use encoded x3a to represent colon in zsh/fish
1 parent 1d634d9 commit 3dd1cc2

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-bash.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ if [ -n "$VSCODE_ENV_REPLACE" ]; then
5050
IFS=':' read -ra ADDR <<< "$VSCODE_ENV_REPLACE"
5151
for ITEM in "${ADDR[@]}"; do
5252
VARNAME="$(echo $ITEM | cut -d "=" -f 1)"
53-
# Use -e to encoded expand colons and other sequences
5453
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
5554
export $VARNAME="$VALUE"
5655
done
@@ -60,7 +59,6 @@ if [ -n "$VSCODE_ENV_PREPEND" ]; then
6059
IFS=':' read -ra ADDR <<< "$VSCODE_ENV_PREPEND"
6160
for ITEM in "${ADDR[@]}"; do
6261
VARNAME="$(echo $ITEM | cut -d "=" -f 1)"
63-
# Use -e to encoded expand colons and other sequences
6462
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
6563
export $VARNAME="$VALUE${!VARNAME}"
6664
done
@@ -70,7 +68,6 @@ if [ -n "$VSCODE_ENV_APPEND" ]; then
7068
IFS=':' read -ra ADDR <<< "$VSCODE_ENV_APPEND"
7169
for ITEM in "${ADDR[@]}"; do
7270
VARNAME="$(echo $ITEM | cut -d "=" -f 1)"
73-
# Use -e to encoded expand colons and other sequences
7471
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
7572
export $VARNAME="${!VARNAME}$VALUE"
7673
done

src/vs/workbench/contrib/terminal/browser/media/shellIntegration-rc.zsh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,26 @@ fi
4040

4141
# Apply EnvironmentVariableCollections if needed
4242
if [ -n "$VSCODE_ENV_REPLACE" ]; then
43-
echo "VSCODE_ENV_REPLACE: $VSCODE_ENV_REPLACE"
4443
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_REPLACE"
4544
for ITEM in "${ADDR[@]}"; do
4645
VARNAME="$(echo ${ITEM%%=*})"
47-
export $VARNAME="${ITEM#*=}"
46+
export $VARNAME="$(echo -e ${ITEM#*=})"
4847
done
4948
unset VSCODE_ENV_REPLACE
5049
fi
5150
if [ -n "$VSCODE_ENV_PREPEND" ]; then
52-
echo "VSCODE_ENV_PREPEND: $VSCODE_ENV_PREPEND"
5351
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_PREPEND"
5452
for ITEM in "${ADDR[@]}"; do
5553
VARNAME="$(echo ${ITEM%%=*})"
56-
export $VARNAME="${ITEM#*=}${(P)VARNAME}"
54+
export $VARNAME="$(echo -e {ITEM#*=})${(P)VARNAME}"
5755
done
5856
unset VSCODE_ENV_PREPEND
5957
fi
6058
if [ -n "$VSCODE_ENV_APPEND" ]; then
61-
echo "VSCODE_ENV_APPEND: $VSCODE_ENV_APPEND"
6259
IFS=':' read -rA ADDR <<< "$VSCODE_ENV_APPEND"
6360
for ITEM in "${ADDR[@]}"; do
6461
VARNAME="$(echo ${ITEM%%=*})"
65-
export $VARNAME="${(P)VARNAME}${ITEM#*=}"
62+
export $VARNAME="${(P)VARNAME}$(echo -e {ITEM#*=})"
6663
done
6764
unset VSCODE_ENV_APPEND
6865
fi

src/vs/workbench/contrib/terminal/browser/media/shellIntegration.fish

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ if test -n "$VSCODE_ENV_REPLACE"
3333
set ITEMS (string split : $VSCODE_ENV_REPLACE)
3434
for B in $ITEMS
3535
set split (string split = $B)
36-
set -gx "$split[1]" "$split[2]"
36+
set -gx "$split[1]" (echo -e "$split[2]")
3737
end
3838
set -e VSCODE_ENV_REPLACE
3939
end
4040
if test -n "$VSCODE_ENV_PREPEND"
4141
set ITEMS (string split : $VSCODE_ENV_PREPEND)
4242
for B in $ITEMS
4343
set split (string split = $B)
44-
set -gx "$split[1]" "$split[2]$$split[1]" # avoid -p as it adds a space
44+
set -gx "$split[1]" (echo -e "$split[2]")"$$split[1]" # avoid -p as it adds a space
4545
end
4646
set -e VSCODE_ENV_PREPEND
4747
end
4848
if test -n "$VSCODE_ENV_APPEND"
4949
set ITEMS (string split : $VSCODE_ENV_APPEND)
5050
for B in $ITEMS
5151
set split (string split = $B)
52-
set -gx "$split[1]" "$$split[1]$split[2]" # avoid -a as it adds a space
52+
set -gx "$split[1]" "$$split[1]"(echo -e "$split[2]") # avoid -a as it adds a space
5353
end
5454
set -e VSCODE_ENV_APPEND
5555
end

0 commit comments

Comments
 (0)