File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -257,6 +257,9 @@ export class UnixTerminal extends Terminal {
257
257
*/
258
258
259
259
public resize ( cols : number , rows : number ) : void {
260
+ if ( cols <= 0 || rows <= 0 || isNaN ( cols ) || isNaN ( rows ) || cols === Infinity || rows === Infinity ) {
261
+ throw new Error ( 'resizing must be done using positive cols and rows' ) ;
262
+ }
260
263
pty . resize ( this . _fd , cols , rows ) ;
261
264
this . _cols = cols ;
262
265
this . _rows = rows ;
Original file line number Diff line number Diff line change @@ -142,7 +142,7 @@ export class WindowsTerminal extends Terminal {
142
142
*/
143
143
144
144
public resize ( cols : number , rows : number ) : void {
145
- if ( cols <= 0 || rows <= 0 ) {
145
+ if ( cols <= 0 || rows <= 0 || isNaN ( cols ) || isNaN ( rows ) || cols === Infinity || rows === Infinity ) {
146
146
throw new Error ( 'resizing must be done using positive cols and rows' ) ;
147
147
}
148
148
this . _defer ( ( ) => {
You can’t perform that action at this time.
0 commit comments