Skip to content

Commit c002405

Browse files
authored
Merge pull request microsoft#210513 from cpendery/fix/git-bash-split
fix: split fails in git bash
2 parents 7d0b912 + d200d08 commit c002405

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ __vsc_escape_value() {
137137
# Send the IsWindows property if the environment looks like Windows
138138
if [[ "$(uname -s)" =~ ^CYGWIN*|MINGW*|MSYS* ]]; then
139139
builtin printf '\e]633;P;IsWindows=True\a'
140+
__vsc_is_windows=1
141+
else
142+
__vsc_is_windows=0
140143
fi
141144

142145
# Allow verifying $BASH_COMMAND doesn't have aliases resolved via history when the right HISTCONTROL
@@ -168,7 +171,12 @@ __vsc_prompt_end() {
168171
}
169172

170173
__vsc_update_cwd() {
171-
builtin printf '\e]633;P;Cwd=%s\a' "$(__vsc_escape_value "$PWD")"
174+
if [ "$__vsc_is_windows" = "1" ]; then
175+
__vsc_cwd="$(cygpath -m "$PWD")"
176+
else
177+
__vsc_cwd="$PWD"
178+
fi
179+
builtin printf '\e]633;P;Cwd=%s\a' "$(__vsc_escape_value "$__vsc_cwd")"
172180
}
173181

174182
__vsc_command_output_start() {

0 commit comments

Comments
 (0)