File tree 1 file changed +8
-3
lines changed
src/vs/platform/terminal/common/capabilities/commandDetection
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -456,17 +456,22 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
456
456
}
457
457
458
458
private _lineContainsContinuationPrompt ( lineText : string ) : boolean {
459
- return ! ! ( this . _continuationPrompt && lineText . startsWith ( this . _continuationPrompt ) ) ;
459
+ return ! ! ( this . _continuationPrompt && lineText . startsWith ( this . _continuationPrompt . trimEnd ( ) ) ) ;
460
460
}
461
461
462
462
private _getContinuationPromptCellWidth ( line : IBufferLine , lineText : string ) : number {
463
- if ( ! this . _continuationPrompt || ! lineText . startsWith ( this . _continuationPrompt ) ) {
463
+ if ( ! this . _continuationPrompt || ! lineText . startsWith ( this . _continuationPrompt . trimEnd ( ) ) ) {
464
464
return 0 ;
465
465
}
466
466
let buffer = '' ;
467
467
let x = 0 ;
468
+ let cell : IBufferCell | undefined ;
468
469
while ( buffer !== this . _continuationPrompt ) {
469
- buffer += line . getCell ( x ++ ) ! . getChars ( ) ;
470
+ cell = line . getCell ( x ++ ) ;
471
+ if ( ! cell ) {
472
+ break ;
473
+ }
474
+ buffer += cell . getChars ( ) ;
470
475
}
471
476
return x ;
472
477
}
You can’t perform that action at this time.
0 commit comments