File tree Expand file tree Collapse file tree
src/vs/workbench/contrib/terminalContrib/stickyScroll/browser Expand file tree Collapse file tree Original file line number Diff line number Diff 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
526540function lineStartsWith ( line : IBufferLine | undefined , text : string ) : boolean {
You can’t perform that action at this time.
0 commit comments