File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -562,8 +562,7 @@ export class Terminal implements ITerminalCore {
562562 // bump viewportY by the same amount to keep the viewport locked on
563563 // the same content.
564564 const savedViewportY = this . viewportY ;
565- const savedScrollback = savedViewportY > 0
566- ? this . wasmTerm ! . getScrollbackLength ( ) : 0 ;
565+ const savedScrollback = savedViewportY > 0 ? this . wasmTerm ! . getScrollbackLength ( ) : 0 ;
567566
568567 // Write directly to WASM terminal (handles VT parsing internally)
569568 this . wasmTerm ! . write ( data ) ;
@@ -590,7 +589,12 @@ export class Terminal implements ITerminalCore {
590589 if ( savedViewportY > 0 ) {
591590 const newScrollback = this . wasmTerm ! . getScrollbackLength ( ) ;
592591 const delta = newScrollback - savedScrollback ;
593- this . viewportY = Math . min ( savedViewportY + Math . max ( 0 , delta ) , newScrollback ) ;
592+ const newViewportY = Math . max ( 0 , Math . min ( savedViewportY + delta , newScrollback ) ) ;
593+ if ( newViewportY !== savedViewportY ) {
594+ this . viewportY = newViewportY ;
595+ this . scrollEmitter . fire ( this . viewportY ) ;
596+ if ( newScrollback > 0 ) this . showScrollbar ( ) ;
597+ }
594598 }
595599
596600 // Check for title changes (OSC 0, 1, 2 sequences)
You can’t perform that action at this time.
0 commit comments