src/vs/platform/terminal/common/terminalDataBuffering.ts/TerminalDataBufferer/startBuffering
class TerminalDataBufferer:	startBuffering(id: number, event: Event<string | IProcessDataEvent>, throttleBy: number = 5): IDisposable {

		const disposable = event((e: string | IProcessDataEvent) => {
			const data = (typeof e === 'string' ? e : e.data);
			let buffer = this._terminalBufferMap.get(id);
			if (buffer) {
				buffer.data.push(data);
				return;
			}

			const timeoutId = setTimeout(() => this.flushBuffer(id), throttleBy);
			buffer = {
				data: [data],
				timeoutId: timeoutId,
				dispose: () => {
					clearTimeout(timeoutId);
					this.flushBuffer(id);
					disposable.dispose();
				}
			};
			this._terminalBufferMap.set(id, buffer);
		});
		return disposable;
	}