@zgeoff/atc 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zgeoff/atc",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Terminal control tower for Claude Code sessions",
5
5
  "homepage": "https://github.com/zgeoff/atc#readme",
6
6
  "bugs": "https://github.com/zgeoff/atc/issues",
@@ -84,10 +84,19 @@ export class ScreenModel {
84
84
  });
85
85
  }
86
86
 
87
- // The terminal parses asynchronously; the replay waits for every recorded
88
- // byte to land in the buffer before serializing.
87
+ // The terminal parses asynchronously, and bytes recorded while a flush is
88
+ // awaited re-arm it — so the replay drains until no newer write is
89
+ // pending. Serializing earlier would omit bytes already streamed live to
90
+ // clients, and the replay's leading clear would erase them from the
91
+ // client's screen for good.
89
92
  async renderReplay(): Promise<string> {
90
- await this.flushed;
93
+ let pending: Promise<void>;
94
+
95
+ do {
96
+ pending = this.flushed;
97
+
98
+ await pending;
99
+ } while (pending !== this.flushed);
91
100
 
92
101
  return RESET_INPUT_MODES + this.serializer.serialize() + this.renderInputModes();
93
102
  }