Fix NPEs on buffer line and windowsPty option

This commit is contained in:
Daniel Imms
2023-06-09 08:47:17 -07:00
parent 380e6805e8
commit ffadc0b31d
2 changed files with 10 additions and 4 deletions
+6 -4
View File
@@ -1152,10 +1152,12 @@ export class InputHandler extends Disposable implements IInputHandler {
* @param y row index
*/
private _resetBufferLine(y: number, respectProtect: boolean = false): void {
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y)!;
line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), respectProtect);
this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);
line.isWrapped = false;
const line = this._activeBuffer.lines.get(this._activeBuffer.ybase + y);
if (line) {
line.fill(this._activeBuffer.getNullCell(this._eraseAttrData()), respectProtect);
this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase + y);
line.isWrapped = false;
}
}
/**
+4
View File
@@ -178,12 +178,16 @@ export class OptionsService extends Disposable implements IOptionsService {
if (value <= 0) {
throw new Error(`${key} cannot be less than or equal to 0, value: ${value}`);
}
break;
case 'rows':
case 'cols':
if (!value && value !== 0) {
throw new Error(`${key} must be numeric, value: ${value}`);
}
break;
case 'windowsPty':
value = value ?? {};
break;
}
return value;
}