MCPcopy Create free account
hub / github.com/codeaashu/claude-code / writeSync

Method writeSync

src/server/web/public/terminal.js:4665–4675  ·  view source on GitHub ↗
(e3, t3)

Source from the content-addressed store, hash-verified

4663 super(), this._action = e3, this._writeBuffer = [], this._callbacks = [], this._pendingData = 0, this._bufferOffset = 0, this._isSyncWriting = false, this._syncCalls = 0, this._didUserInput = false, this._onWriteParsed = this.register(new s2.EventEmitter()), this.onWriteParsed = this._onWriteParsed.event;
4664 }
4665 handleUserInput() {
4666 this._didUserInput = true;
4667 }
4668 writeSync(e3, t3) {
4669 if (void 0 !== t3 && this._syncCalls > t3) return void (this._syncCalls = 0);
4670 if (this._pendingData += e3.length, this._writeBuffer.push(e3), this._callbacks.push(void 0), this._syncCalls++, this._isSyncWriting) return;
4671 let i3;
4672 for (this._isSyncWriting = true; i3 = this._writeBuffer.shift(); ) {
4673 this._action(i3);
4674 const e4 = this._callbacks.shift();
4675 e4 && e4();
4676 }
4677 this._pendingData = 0, this._bufferOffset = 2147483647, this._isSyncWriting = false, this._syncCalls = 0;
4678 }

Callers

nothing calls this directly

Calls 2

shiftMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected