Skip to content

Commit 18981d2

Browse files
authored
Merge pull request microsoft#218435 from microsoft/tyriar/215482
Fix missing cases for not reporting prompts
2 parents a11a0d7 + b37c33d commit 18981d2

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ __vsc_stable="$VSCODE_STABLE"
175175
unset VSCODE_STABLE
176176

177177
# Report continuation prompt
178-
builtin printf "\e]633;P;ContinuationPrompt=$(echo "$PS2" | sed 's/\x1b/\\\\x1b/g')\a"
178+
if [ "$__vsc_stable" = "0" ]; then
179+
builtin printf "\e]633;P;ContinuationPrompt=$(echo "$PS2" | sed 's/\x1b/\\\\x1b/g')\a"
180+
fi
179181

180182
__vsc_report_prompt() {
181183
# Expand the original PS1 similarly to how bash would normally

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function Global:Prompt() {
9898

9999
# Prompt
100100
# OSC 633 ; <Property>=<Value> ST
101-
if ($isStable -eq "1") {
101+
if ($isStable -eq "0") {
102102
$Result += "$([char]0x1b)]633;P;Prompt=$(__VSCode-Escape-Value $OriginalPrompt)`a"
103103
}
104104

@@ -147,9 +147,11 @@ else {
147147
}
148148

149149
# Set ContinuationPrompt property
150-
$ContinuationPrompt = (Get-PSReadLineOption).ContinuationPrompt
151-
if ($ContinuationPrompt) {
152-
[Console]::Write("$([char]0x1b)]633;P;ContinuationPrompt=$(__VSCode-Escape-Value $ContinuationPrompt)`a")
150+
if ($isStable -eq "0") {
151+
$ContinuationPrompt = (Get-PSReadLineOption).ContinuationPrompt
152+
if ($ContinuationPrompt) {
153+
[Console]::Write("$([char]0x1b)]633;P;ContinuationPrompt=$(__VSCode-Escape-Value $ContinuationPrompt)`a")
154+
}
153155
}
154156

155157
# Set always on key handlers which map to default VS Code keybindings

0 commit comments

Comments
 (0)