MCPcopy
hub / github.com/wavetermdev/waveterm / handleNewFileSubjectData

Method handleNewFileSubjectData

frontend/app/view/term/termwrap.ts:479–494  ·  view source on GitHub ↗
(msg: WSFileEventData)

Source from the content-addressed store, hash-verified

477 }
478
479 handleNewFileSubjectData(msg: WSFileEventData) {
480 if (msg.fileop == "truncate") {
481 this.terminal.clear();
482 this.heldData = [];
483 } else if (msg.fileop == "append") {
484 const decodedData = base64ToArray(msg.data64);
485 if (this.loaded) {
486 this.doTerminalWrite(decodedData, null);
487 } else {
488 this.heldData.push(decodedData);
489 }
490 } else {
491 console.log("bad fileop for terminal", msg);
492 return;
493 }
494 }
495
496 doTerminalWrite(data: string | Uint8Array, setPtyOffset?: number): Promise<void> {
497 if (isDev() && this.loaded) {

Callers

nothing calls this directly

Calls 4

doTerminalWriteMethod · 0.95
base64ToArrayFunction · 0.90
clearMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected