Skip to content

Commit 1d634d9

Browse files
committed
Use encoded x3a to represent colon in bash
Part of microsoft#181934
1 parent 44a490b commit 1d634d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ 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-
VALUE="$(echo $ITEM | cut -d "=" -f 2)"
53+
# Use -e to encoded expand colons and other sequences
54+
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
5455
export $VARNAME="$VALUE"
5556
done
5657
builtin unset VSCODE_ENV_REPLACE
@@ -59,7 +60,8 @@ if [ -n "$VSCODE_ENV_PREPEND" ]; then
5960
IFS=':' read -ra ADDR <<< "$VSCODE_ENV_PREPEND"
6061
for ITEM in "${ADDR[@]}"; do
6162
VARNAME="$(echo $ITEM | cut -d "=" -f 1)"
62-
VALUE="$(echo $ITEM | cut -d "=" -f 2)"
63+
# Use -e to encoded expand colons and other sequences
64+
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
6365
export $VARNAME="$VALUE${!VARNAME}"
6466
done
6567
builtin unset VSCODE_ENV_PREPEND
@@ -68,7 +70,8 @@ if [ -n "$VSCODE_ENV_APPEND" ]; then
6870
IFS=':' read -ra ADDR <<< "$VSCODE_ENV_APPEND"
6971
for ITEM in "${ADDR[@]}"; do
7072
VARNAME="$(echo $ITEM | cut -d "=" -f 1)"
71-
VALUE="$(echo $ITEM | cut -d "=" -f 2)"
73+
# Use -e to encoded expand colons and other sequences
74+
VALUE="$(echo -e "$ITEM" | cut -d "=" -f 2)"
7275
export $VARNAME="${!VARNAME}$VALUE"
7376
done
7477
builtin unset VSCODE_ENV_APPEND

0 commit comments

Comments
 (0)