Skip to content

Commit 2712eee

Browse files
authored
Merge branch 'main' into eli/prompt-tile-style-clean
2 parents 801f4a1 + 9f2fcb6 commit 2712eee

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export class TerminalStickyScrollOverlay extends Disposable {
227227
// scroll.
228228
this._currentStickyCommand = undefined;
229229

230-
// No command
231-
if (!command) {
230+
// No command or clear command
231+
if (!command || this._isClearCommand(command)) {
232232
this._setVisible(false);
233233
return;
234234
}
@@ -521,6 +521,20 @@ export class TerminalStickyScrollOverlay extends Disposable {
521521
selectionInactiveBackground: undefined
522522
};
523523
}
524+
525+
private _isClearCommand(command: ITerminalCommand | ICurrentPartialCommand): boolean {
526+
if (!command.command) {
527+
return false;
528+
}
529+
const trimmedCommand = command.command.trim().toLowerCase();
530+
const clearCommands = [
531+
'clear',
532+
'cls',
533+
'clear-host',
534+
];
535+
536+
return clearCommands.includes(trimmedCommand);
537+
}
524538
}
525539

526540
function lineStartsWith(line: IBufferLine | undefined, text: string): boolean {

0 commit comments

Comments
 (0)