thinkpool-pair 0.3.5 → 0.3.6
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/bridge.mjs +17 -14
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -152,22 +152,25 @@ const flushAll = () => {
|
|
|
152
152
|
const flushTimer = setInterval(flushAll, 35)
|
|
153
153
|
|
|
154
154
|
// ── shared-PTY geometry ───────────────────────────────────────────
|
|
155
|
-
// The
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
//
|
|
163
|
-
//
|
|
164
|
-
|
|
155
|
+
// The attached PTY is CAPPED at 120×32, never pinned (2026-06-11).
|
|
156
|
+
// Mangling physics: a PTY *wider/taller* than the host's window forces
|
|
157
|
+
// mid-line wraps → the host's own view shreds (the 2026-06-10 pin did
|
|
158
|
+
// exactly this to any window under 120 cols). A PTY *smaller* than the
|
|
159
|
+
// window is harmless — it just leaves an empty margin. So per axis:
|
|
160
|
+
// attached = min(host TTY, 120×32)
|
|
161
|
+
// Host view is always clean (PTY ≤ window); web viewers never get
|
|
162
|
+
// microscopic text (grid ≤ 120 cols — the original reason for the pin;
|
|
163
|
+
// they render the exact grid and scale, per d78c978).
|
|
164
|
+
// TP_COLS/TP_ROWS force an exact size (you own the consequences);
|
|
165
|
+
// TP_FOLLOW=1 follows the host window uncapped (solo screen-mirror).
|
|
166
|
+
const CAP_COLS = 120, CAP_ROWS = 32
|
|
167
|
+
const FALLBACK_COLS = 100, FALLBACK_ROWS = 28 // stdout size unknown (rare)
|
|
165
168
|
const FOLLOW = process.env.TP_FOLLOW === '1'
|
|
166
|
-
const PIN_COLS = parseInt(process.env.TP_COLS, 10) ||
|
|
167
|
-
const PIN_ROWS = parseInt(process.env.TP_ROWS, 10) ||
|
|
169
|
+
const PIN_COLS = parseInt(process.env.TP_COLS, 10) || null
|
|
170
|
+
const PIN_ROWS = parseInt(process.env.TP_ROWS, 10) || null
|
|
168
171
|
const attachedDims = () => ({
|
|
169
|
-
cols: PIN_COLS || Math.
|
|
170
|
-
rows: PIN_ROWS || Math.
|
|
172
|
+
cols: PIN_COLS || (FOLLOW ? (process.stdout.columns || FALLBACK_COLS) : Math.min(process.stdout.columns || FALLBACK_COLS, CAP_COLS)),
|
|
173
|
+
rows: PIN_ROWS || (FOLLOW ? (process.stdout.rows || FALLBACK_ROWS) : Math.min(process.stdout.rows || FALLBACK_ROWS, CAP_ROWS)),
|
|
171
174
|
})
|
|
172
175
|
|
|
173
176
|
function openTerm({ id, cmd, args = [], attached = false, cols, rows }) {
|
package/package.json
CHANGED