Skip to content
C.W.K.
Stream
Lesson 04 of 05 · published

Observation Must Not Resize

~12 min · spectator, resize, fit, pan, pty

Level 0Spark
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

A Narrow Glass Is Not a New Layout

You open an existing Mac session as a spectator on a phone. The Mac has a hundred-and-twenty columns you laid out for four Anvil seats, or an editor, or htop at a width the TUI expected. The phone has a narrow portrait grid. If observation resizes the host PTY to the phone's columns, the Mac layout is no longer owned. TUIs reflow. Editors wrap. Four seats become unreadable on the glass you were actually working at. A spectator who resizes is not a spectator. They are a layout thief with a smaller screen.

The rule is brutal and short: only the controlling surface may resize. Observation fits or pans the grid. Fit means the existing cells are scaled or letterboxed so they remain the same cells. Pan means you slide across a grid that is larger than the glass. Neither sends a new size to the child. The PTY's rows and columns stay the Mac's — or whoever currently holds the input lease and has the right to change them.

Fit and Pan Are Projection, Not Protocol

Those are drawing choices on the phone. They do not travel as "please become 40x12." The wire may say "here is the current grid size, here are the bytes." It may not say, from a spectator, "make the grid this." If a spectator gesture can emit a resize, the lease has leaked. Track 6 will make the lease singular; this lesson is the geometric half of that singularity. Input is one writer. Size is one writer. They are usually the same writer. A spectator is neither.

Rotation on a phone is the sharp test. Portrait to landscape looks like a resize request. For a spectator, it is a fit-or-pan request. The glass changed. The child did not ask to change, and the Mac operator did not ask either. Treating rotation as SIGWINCH is how a pocket glance reflows a TUI the typist is in the middle of. The destination track will say durable mobile work needs checkpoints because rotation also wrecks parser state if you were the controller. Different tense, same geometry: the child's size is not a function of whoever is looking.

The Mac Can Be the Spectator Too

Once a phone has taken control, the Mac window is a spectator unless it takes control back. Then the Mac must not resize just because the window was dragged. The controlling surface is the phone; the Mac fits or pans, or it takes the lease and then resizes. Two writers of size are how you get a character of layout from each glass in the same moment, which is the same failure as two writers of input.

Copy still works for a spectator. You can select text, you can read the journal. You cannot send a terminal reply, you cannot grow the grid, you cannot terminate. Those refusals are one family. Resize is the one people forget because it does not look like typing. It is typing, to a TUI. Name it that way in review.

Only the controlling surface may resize. A spectator fits or pans. Rotation is a new glass, not a new PTY. A spectator who changes columns is a layout thief, and a TUI will remember.

Code

Who may change the child's idea of the world·text
surface role     input    resize     copy/scroll    terminate
controller       yes      yes        yes            yes (if product says so)
spectator        no       no         yes            no

# Spectator drawing (phone or Mac)
  fit  = scale / letterbox the EXISTING cols x rows
  pan  = slide a camera over the EXISTING grid
  neither emits SIGWINCH

# Sharp tests
  phone rotation while spectator     -> fit/pan, not resize
  Mac window drag while spectator    -> fit/pan, not resize
  phone rotation while controller    -> now it MAY resize (lease held)
  spectator pinch                    -> zoom of pixels, not new cols

# Leak
  onGeometryChange -> daemon.resize(cols, rows)  // forbidden without lease

External links

Exercise

A Mac session is 120x40 with lazygit open. A phone attaches as spectator in portrait. Write what the phone does with the grid (fit, pan, or resize) and what lazygit's idea of width is. Then rotate the phone. Write both answers again. If lazygit's width changed while you were a spectator, you emitted a SIGWINCH you were not allowed to emit.
Hint
The child's width should be 120 in every spectator sentence. The glass can show less of it, or show it smaller. It cannot rewrite it.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.