@@ -1064,10 +1064,14 @@ export class InputHandler extends Disposable implements IInputHandler {
1064
1064
* - always left shift (no line orientation setting respected)
1065
1065
*/
1066
1066
public scrollLeft ( params : IParams ) : void {
1067
+ const buffer = this . _bufferService . buffer ;
1068
+ if ( buffer . y > buffer . scrollBottom || buffer . y < buffer . scrollTop ) {
1069
+ return ;
1070
+ }
1067
1071
const param = params . params [ 0 ] || 1 ;
1068
- for ( let y = 0 ; y < this . _bufferService . rows ; ++ y ) {
1069
- const line = this . _bufferService . buffer . lines . get ( this . _bufferService . buffer . ybase + y ) ;
1070
- line . deleteCells ( 0 , param , this . _bufferService . buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1072
+ for ( let y = buffer . scrollTop ; y <= buffer . scrollBottom ; ++ y ) {
1073
+ const line = buffer . lines . get ( buffer . ybase + y ) ;
1074
+ line . deleteCells ( 0 , param , buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1071
1075
line . isWrapped = false ;
1072
1076
}
1073
1077
}
@@ -1087,10 +1091,14 @@ export class InputHandler extends Disposable implements IInputHandler {
1087
1091
* - always right shift (no line orientation setting respected)
1088
1092
*/
1089
1093
public scrollRight ( params : IParams ) : void {
1094
+ const buffer = this . _bufferService . buffer ;
1095
+ if ( buffer . y > buffer . scrollBottom || buffer . y < buffer . scrollTop ) {
1096
+ return ;
1097
+ }
1090
1098
const param = params . params [ 0 ] || 1 ;
1091
- for ( let y = 0 ; y < this . _bufferService . rows ; ++ y ) {
1092
- const line = this . _bufferService . buffer . lines . get ( this . _bufferService . buffer . ybase + y ) ;
1093
- line . insertCells ( 0 , param , this . _bufferService . buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1099
+ for ( let y = buffer . scrollTop ; y <= buffer . scrollBottom ; ++ y ) {
1100
+ const line = buffer . lines . get ( buffer . ybase + y ) ;
1101
+ line . insertCells ( 0 , param , buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1094
1102
line . isWrapped = false ;
1095
1103
}
1096
1104
}
@@ -1100,10 +1108,14 @@ export class InputHandler extends Disposable implements IInputHandler {
1100
1108
* Insert Ps Column(s) (default = 1) (DECIC), VT420 and up.
1101
1109
*/
1102
1110
public insertColumns ( params : IParams ) : void {
1111
+ const buffer = this . _bufferService . buffer ;
1112
+ if ( buffer . y > buffer . scrollBottom || buffer . y < buffer . scrollTop ) {
1113
+ return ;
1114
+ }
1103
1115
const param = params . params [ 0 ] || 1 ;
1104
- for ( let y = 0 ; y < this . _bufferService . rows ; ++ y ) {
1105
- const line = this . _bufferService . buffer . lines . get ( this . _bufferService . buffer . ybase + y ) ;
1106
- line . insertCells ( this . _bufferService . buffer . x , param , this . _bufferService . buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1116
+ for ( let y = buffer . scrollTop ; y <= buffer . scrollBottom ; ++ y ) {
1117
+ const line = this . _bufferService . buffer . lines . get ( buffer . ybase + y ) ;
1118
+ line . insertCells ( buffer . x , param , buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1107
1119
line . isWrapped = false ;
1108
1120
}
1109
1121
}
@@ -1113,10 +1125,14 @@ export class InputHandler extends Disposable implements IInputHandler {
1113
1125
* Delete Ps Column(s) (default = 1) (DECDC), VT420 and up.
1114
1126
*/
1115
1127
public deleteColumns ( params : IParams ) : void {
1128
+ const buffer = this . _bufferService . buffer ;
1129
+ if ( buffer . y > buffer . scrollBottom || buffer . y < buffer . scrollTop ) {
1130
+ return ;
1131
+ }
1116
1132
const param = params . params [ 0 ] || 1 ;
1117
- for ( let y = 0 ; y < this . _bufferService . rows ; ++ y ) {
1118
- const line = this . _bufferService . buffer . lines . get ( this . _bufferService . buffer . ybase + y ) ;
1119
- line . deleteCells ( this . _bufferService . buffer . x , param , this . _bufferService . buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1133
+ for ( let y = buffer . scrollTop ; y <= buffer . scrollBottom ; ++ y ) {
1134
+ const line = buffer . lines . get ( buffer . ybase + y ) ;
1135
+ line . deleteCells ( buffer . x , param , buffer . getNullCell ( this . _terminal . eraseAttrData ( ) ) ) ;
1120
1136
line . isWrapped = false ;
1121
1137
}
1122
1138
}
0 commit comments