Skip to content

Commit dec68f6

Browse files
committed
fix: prompt height calculations
Signed-off-by: Chapman Pendery <[email protected]>
1 parent c524eef commit dec68f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ __vsc_update_cwd() {
180180
}
181181

182182
__vsc_update_prompt_height() {
183-
__vsc_prompt_height="$(builtin printf "%s" "${PS1@P}" | wc -l)"
183+
__vsc_prompt_height="$(("$(builtin printf "%s" "${PS1@P}" | wc -l)" + 1))"
184184
builtin printf '\e]633;P;PromptHeight=%s\a' "$(__vsc_escape_value "$__vsc_prompt_height")"
185185
}
186186

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ function Global:Prompt() {
9595

9696
# Prompt height
9797
# OSC 633 ; <Property>=<Value> ST
98-
$Result += "$([char]0x1b)]633;P;PromptHeight=$(__VSCode-Escape-Value ($OriginalPrompt -Split '\n').Count - 1)`a"
98+
$Result += "$([char]0x1b)]633;P;PromptHeight=$(__VSCode-Escape-Value ($OriginalPrompt -Split '\n').Count)`a"
9999

100100
# Write command started
101101
$Result += "$([char]0x1b)]633;B`a"

0 commit comments

Comments
 (0)