提交 3ea65cf7 编写于 作者: I isidor

output: limit buffer

fixes #4127
上级 bb5940fa
......@@ -83,7 +83,11 @@ export class OutputEditorInput extends StringEditorInput {
private onOutputReceived(e: IOutputEvent): void {
if (this.outputSet && e.channel === this.channel) {
if (e.output) {
this.bufferedOutput += e.output;
if (this.bufferedOutput.length + e.output.length > MAX_OUTPUT_LENGTH) {
this.bufferedOutput = '...' + this.bufferedOutput.substr(this.bufferedOutput.length + e.output.length - MAX_OUTPUT_LENGTH);
}
this.bufferedOutput += e.output.substr(0, MAX_OUTPUT_LENGTH);
this.scheduleOutputAppend();
} else if (e.output === null) {
this.clearValue(); // special output indicates we should clear
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册