thinkpool-pair 0.3.4 → 0.3.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/bridge.mjs +14 -9
- package/package.json +1 -1
package/bridge.mjs
CHANGED
|
@@ -152,14 +152,19 @@ const flushAll = () => {
|
|
|
152
152
|
const flushTimer = setInterval(flushAll, 35)
|
|
153
153
|
|
|
154
154
|
// ── shared-PTY geometry ───────────────────────────────────────────
|
|
155
|
-
// The room's view is the product: the shared PTY
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
//
|
|
155
|
+
// The room's view is the product. DEFAULT: the shared PTY is PINNED to a
|
|
156
|
+
// standard 120×32 — one source resolution chosen for web legibility
|
|
157
|
+
// (scale ≈1 on a laptop pane), regardless of the host's window. A huge
|
|
158
|
+
// host window made viewers' text microscopic; a tiny one broke their
|
|
159
|
+
// layout — both ends of the same bug (2026-06-10). The host's local
|
|
160
|
+
// terminal just doesn't use its extra space; below 120×32 it wraps
|
|
161
|
+
// oddly locally, the room stays clean.
|
|
162
|
+
// TP_COLS/TP_ROWS pin a different size. TP_FOLLOW=1 restores
|
|
163
|
+
// follow-the-host-window (floored), for solo screen-mirror use.
|
|
160
164
|
const FLOOR_COLS = 100, FLOOR_ROWS = 28
|
|
161
|
-
const
|
|
162
|
-
const
|
|
165
|
+
const FOLLOW = process.env.TP_FOLLOW === '1'
|
|
166
|
+
const PIN_COLS = parseInt(process.env.TP_COLS, 10) || (FOLLOW ? null : 120)
|
|
167
|
+
const PIN_ROWS = parseInt(process.env.TP_ROWS, 10) || (FOLLOW ? null : 32)
|
|
163
168
|
const attachedDims = () => ({
|
|
164
169
|
cols: PIN_COLS || Math.max(process.stdout.columns || FLOOR_COLS, FLOOR_COLS),
|
|
165
170
|
rows: PIN_ROWS || Math.max(process.stdout.rows || FLOOR_ROWS, FLOOR_ROWS),
|
|
@@ -170,8 +175,8 @@ function openTerm({ id, cmd, args = [], attached = false, cols, rows }) {
|
|
|
170
175
|
const ad = attached ? attachedDims() : null
|
|
171
176
|
const term = pty.spawn(cmd, args, {
|
|
172
177
|
name: 'xterm-256color',
|
|
173
|
-
cols: cols || (attached ? ad.cols :
|
|
174
|
-
rows: rows || (attached ? ad.rows :
|
|
178
|
+
cols: cols || (attached ? ad.cols : (PIN_COLS || 120)),
|
|
179
|
+
rows: rows || (attached ? ad.rows : (PIN_ROWS || 32)),
|
|
175
180
|
cwd: process.cwd(), env: process.env,
|
|
176
181
|
})
|
|
177
182
|
const entry = { term, cmd, attached, scrollback: '', buf: '' }
|
package/package.json
CHANGED