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.
Files changed (2) hide show
  1. package/bridge.mjs +14 -9
  2. 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 never goes below
156
- // FLOOR_COLS×FLOOR_ROWS, no matter what the host does to their local
157
- // window. Below the floor the HOST's rendering wraps oddly (the agent
158
- // keeps drawing for the floor width) the pair's view stays clean.
159
- // Pin an exact size with TP_COLS/TP_ROWS (disables host-following).
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 PIN_COLS = parseInt(process.env.TP_COLS, 10) || null
162
- const PIN_ROWS = parseInt(process.env.TP_ROWS, 10) || null
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 : 100),
174
- rows: rows || (attached ? ad.rows : 30),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Share a local coding-agent CLI (Claude Code, Codex, Gemini, Aider, …) into a ThinkPool Code room, live.",
5
5
  "type": "module",
6
6
  "bin": { "thinkpool-pair": "bridge.mjs" },