File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed
src/vs/platform/terminal/common/capabilities/commandDetection Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -113,13 +113,14 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
113
113
return ;
114
114
}
115
115
116
+ // Command start line
116
117
this . _value = commandLine . substring ( this . _commandStartX ) ;
117
118
this . _cursorIndex = Math . max ( buffer . cursorX - this . _commandStartX , 0 ) ;
118
119
119
120
// IDEA: Reinforce knowledge of prompt to avoid incorrect commandStart
120
121
// IDEA: Detect ghost text based on SGR and cursor
121
122
122
- // Add multi-lines
123
+ // From command start line to cursor line
123
124
const absoluteCursorY = buffer . baseY + buffer . cursorY ;
124
125
for ( let y = commandStartY + 1 ; y <= absoluteCursorY ; y ++ ) {
125
126
let lineText = buffer . getLine ( y ) ?. translateToString ( true ) ;
@@ -140,13 +141,15 @@ export class PromptInputModel extends Disposable implements IPromptInputModel {
140
141
}
141
142
}
142
143
143
- // Check lines below the cursor for continuations
144
+ // Below cursor line
144
145
for ( let y = absoluteCursorY + 1 ; y < buffer . baseY + this . _xterm . rows ; y ++ ) {
145
146
const lineText = buffer . getLine ( y ) ?. translateToString ( true ) ;
146
- if ( lineText && this . _lineContainsContinuationPrompt ( lineText ) ) {
147
- this . _value += `\n${ this . _trimContinuationPrompt ( lineText ) } ` ;
148
- } else {
149
- break ;
147
+ if ( lineText ) {
148
+ if ( this . _continuationPrompt === undefined || this . _lineContainsContinuationPrompt ( lineText ) ) {
149
+ this . _value += `\n${ this . _trimContinuationPrompt ( lineText ) } ` ;
150
+ } else {
151
+ break ;
152
+ }
150
153
}
151
154
}
152
155
You can’t perform that action at this time.
0 commit comments