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.
Files changed (2) hide show
  1. package/bridge.mjs +17 -14
  2. 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 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
- // layoutboth 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.
164
- const FLOOR_COLS = 100, FLOOR_ROWS = 28
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) || (FOLLOW ? null : 120)
167
- const PIN_ROWS = parseInt(process.env.TP_ROWS, 10) || (FOLLOW ? null : 32)
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.max(process.stdout.columns || FLOOR_COLS, FLOOR_COLS),
170
- rows: PIN_ROWS || Math.max(process.stdout.rows || FLOOR_ROWS, FLOOR_ROWS),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thinkpool-pair",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
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" },