teapot-coding-agent 0.34.3 → 0.34.5
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/dist/server/terminals.js +24 -3
- package/package.json +1 -1
- package/public/assets/{index-B7JtKmn4.js → index-qtAnIT_k.js} +11 -11
- package/public/assets/index-qtAnIT_k.js.map +1 -0
- package/public/assets/{shiki-BysF_oOw.js → shiki-D0HJYMih.js} +2 -2
- package/public/assets/{shiki-BysF_oOw.js.map → shiki-D0HJYMih.js.map} +1 -1
- package/public/index.html +1 -1
- package/public/assets/index-B7JtKmn4.js.map +0 -1
package/dist/server/terminals.js
CHANGED
|
@@ -34,6 +34,14 @@ export function setTerminalResize(fn, slave) {
|
|
|
34
34
|
resizeFn = fn;
|
|
35
35
|
slaveFn = slave;
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* The size a pty is seeded with before any client reports one.
|
|
39
|
+
*
|
|
40
|
+
* Only a placeholder: `script` starts the pty at 0x0, so the shell would print its first prompt
|
|
41
|
+
* wrapped at zero columns. Chosen to be a plausible terminal so that prompt looks normal.
|
|
42
|
+
*/
|
|
43
|
+
const SEED_ROWS = 30;
|
|
44
|
+
const SEED_COLS = 100;
|
|
37
45
|
/** keep this much recent output — enough for a full repaint after a reload */
|
|
38
46
|
const BUFFER_BYTES = 200_000;
|
|
39
47
|
/** how many terminals one agent may hold, matching the UI's 10-tab cap */
|
|
@@ -123,10 +131,23 @@ export function createTerminal(agentId, workspace, title) {
|
|
|
123
131
|
const seed = (tries) => {
|
|
124
132
|
if (t.exited)
|
|
125
133
|
return;
|
|
126
|
-
// stop as soon as the slave resolves: re-applying to a pty that already has this size is
|
|
127
|
-
// a no-op inside the tracker, but there is no reason to keep a timer alive
|
|
128
134
|
if (slaveFn?.(child)) {
|
|
129
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Seed the size ONLY if no client has reported one yet (#172).
|
|
137
|
+
*
|
|
138
|
+
* MEASURED bug: "稼働中のnanoにリサイズが効かない、閉じて再度開けば効く". The seed runs at
|
|
139
|
+
* ~30ms, applying 30x100 to the pty. A client that had already attached and sent its real
|
|
140
|
+
* size lost that race — and because the seed went through the same tracker, the client's
|
|
141
|
+
* size was then deduped as "already applied" if it happened to equal the seed, or simply
|
|
142
|
+
* overwritten by it. The program opened at the seed's geometry and only a NEW size (which
|
|
143
|
+
* arrives when the tab is re-attached, i.e. "close and reopen nano") fixed it.
|
|
144
|
+
*
|
|
145
|
+
* The seed exists for one reason: `script` starts the pty at 0x0, so a shell prints its
|
|
146
|
+
* prompt wrapped at zero columns before any client speaks. Once a client HAS spoken, its
|
|
147
|
+
* size is the truth and seeding must stand down.
|
|
148
|
+
*/
|
|
149
|
+
if (t.sizes.size === 0)
|
|
150
|
+
resizeFn?.(child, SEED_ROWS, SEED_COLS);
|
|
130
151
|
return;
|
|
131
152
|
}
|
|
132
153
|
if (tries > 0)
|