src/vs/platform/terminal/common/terminalRecorder.ts/TerminalRecorder/handleData
class TerminalRecorder:	handleData(data: string): void {
		const lastEntry = this._entries[this._entries.length - 1];
		lastEntry.data.push(data);

		this._totalDataLength += data.length;
		while (this._totalDataLength > MAX_RECORDER_DATA_SIZE) {
			const firstEntry = this._entries[0];
			const remainingToDelete = this._totalDataLength - MAX_RECORDER_DATA_SIZE;
			if (remainingToDelete >= firstEntry.data[0].length) {
				// the first data piece must be deleted
				this._totalDataLength -= firstEntry.data[0].length;
				firstEntry.data.shift();
				if (firstEntry.data.length === 0) {
					// the first entry must be deleted
					this._entries.shift();
				}
			} else {
				// the first data piece must be partially deleted
				firstEntry.data[0] = firstEntry.data[0].substr(remainingToDelete);
				this._totalDataLength -= remainingToDelete;
			}
		}
	}