Skip to content

Commit b7ebab6

Browse files
anthonykim1Tyriar
andauthored
Update src/features/terminal/utils.ts
Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
1 parent dc221fa commit b7ebab6

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/features/terminal/utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ export async function waitForShellIntegration(terminal: Terminal): Promise<boole
4444

4545
// Condition 3: Detect prompt patterns in terminal output
4646
new Promise<boolean>((resolve) => {
47-
let dataSoFar = '';
47+
const dataEvents: string = [];
4848
const debounced = createSimpleDebounce(50, () => {
49-
if (dataSoFar && detectsCommonPromptPattern(dataSoFar)) {
49+
if (dataEvents && detectsCommonPromptPattern(dataEvents.join(''))) {
5050
resolve(false);
5151
}
5252
});
5353
disposables.push(
5454
onDidWriteTerminalData((e) => {
5555
if (e.terminal === terminal) {
56-
dataSoFar += e.data;
56+
dataEvents.push(e.data);
5757
debounced.trigger();
5858
}
5959
}),

0 commit comments

Comments
 (0)