8000 Merge pull request #221998 from kapodamy/main · githubnext/vscode@66edca3 · GitHub
[go: up one dir, main page]

Skip to content 65F2

Commit 66edca3

Browse files
authored
Merge pull request microsoft#221998 from kapodamy/main
fix: place regex in variables on `shellIntegration-bash.sh` script
2 parents 0eec437 + f0f8707 commit 66edca3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ __vsc_escape_value() {
143143
}
144144

145145
# Send the IsWindows property if the environment looks like Windows
146-
if [[ "$(uname -s)" =~ ^CYGWIN*|MINGW*|MSYS* ]]; then
146+
__vsc_regex_environment="^CYGWIN*|MINGW*|MSYS*"
147+
if [[ "$(uname -s)" =~ $__vsc_regex_environment ]]; then
147148
builtin printf '\e]633;P;IsWindows=True\a'
148149
__vsc_is_windows=1
149150
else
@@ -152,12 +153,16 @@ fi
152153

153154
# Allow verifying $BASH_COMMAND doesn't have aliases resolved via history when the right HISTCONTROL
154155
# configuration is used
155-
if [[ "$HISTCONTROL" =~ .*(erasedups|ignoreboth|ignoredups).* ]]; then
156+
__vsc_regex_histcontrol=".*(erasedups|ignoreboth|ignoredups).*"
157+
if [[ "$HISTCONTROL" =~ $__vsc_regex_histcontrol ]]; then
156158
__vsc_history_verify=0
157159
else
158160
__vsc_history_verify=1
159161
fi
160162

163+
builtin unset __vsc_regex_environment
164+
builtin unset __vsc_regex_histcontrol
165+
161166
__vsc_initialized=0
162167
__vsc_original_PS1="$PS1"
163168
__vsc_original_PS2="$PS2"

0 commit comments

Comments
 (0)
0