File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,6 +222,15 @@ export class TerminalAddon implements ITerminalAddon {
222222 }
223223
224224 if ( this . inputBuffer . length === this . cursor ) {
225+ try {
226+ if ( typeof ( this . term as any ) . scrollToBottom === 'function' ) {
227+ ( this . term as any ) . scrollToBottom ( ) ;
228+ } else if ( typeof ( this . term as any ) . scrollLines === 'function' ) {
229+ ( this . term as any ) . scrollLines ( this . termSize . rows ) ;
230+ }
231+ } catch ( e ) {
232+ // ignore
233+ }
225234 return ;
226235 }
227236
@@ -233,6 +242,17 @@ export class TerminalAddon implements ITerminalAddon {
233242 if ( cursorPosition . col > 0 ) {
234243 this . term . write ( VT . CursorForward ( cursorPosition . col ) ) ;
235244 }
245+
246+ // Ensure the last line is visible after moving the cursor
247+ try {
248+ if ( typeof ( this . term as any ) . scrollToBottom === 'function' ) {
249+ ( this . term as any ) . scrollToBottom ( ) ;
250+ } else if ( typeof ( this . term as any ) . scrollLines === 'function' ) {
251+ ( this . term as any ) . scrollLines ( this . termSize . rows ) ;
252+ }
253+ } catch ( e ) {
254+ // ignore
255+ }
236256 } ;
237257
238258 private calcCursorPosition ( ) : TerminalPosition {
You can’t perform that action at this time.
0 commit comments