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

Shells Stay on the Host

~11 min · ios, host, surface, pty, disconnect

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

The Phone Is Glass, Not a Factory

Open Smolder on a phone and you are looking at a surface, not starting a second terminal owner. Shells, PTYs, CLI processes run on the Mac — or on another remote host the Mac's daemon already knew how to reach. The phone does not grow a local PTY. It does not hold SSH keys for those jobs (a later destination about keys on the phone is a different owner, on the phone, for a different transport). It attaches, it draws, it may vanish. Track 2 already made disappearance a closed attachment. This lesson names where the fire lives so the pocket half cannot quietly become a factory.

If the phone owned the process, locking it would be a kill, backgrounding it would be a coin flip, and a dropped network would be a SIGHUP. You would never open a long job from a train. The whole iOS half of this quest — watch first, gateway, destination — collapses unless the daemon remains the owner. Read this as the same split as "the app is a projection," now with a second projection that fits in a pocket.

Disconnect Is Not a Request to End

Losing connectivity, locking, being killed by the operating system: those close the phone's attachment. They are not a request to end the host session. The Mac may still be attached. Another phone may still be attached, as a spectator. The child does not hear about the glass. POSIX hangup stays intercepted. If a session log ever shows a child exiting because an iOS lifecycle event fired, the surface has leaked into ownership and the leak is a defect, not an iOS quirk.

This is also why "run the shell on the phone, it is simpler" is not a simplification. It is a second factory with a battery and a killer OS. Simpler for a demo. Hostile for a compiler. The working contract you can hold today is continue-host-work: observe a host session, take control of a host session, open a shell or CLI through the host. Direct iOS SSH is a later destination with a different owner. Do not mix those tenses here. Today the host holds the fire.

Two Surfaces, Still One Lifetime

The Mac app can quit with preservation and the phone can watch the same jobs. The phone can lock and the Mac can keep typing. Those sentences are only true if lifetime lives in the daemon. A design that starts a local process on iOS "just for this pane" has split the fire, and restore, receipts, and Anvil seats then have to guess which device owned the child. Guessing is how you type into the wrong brain from a pocket.

Prove it without romance: start a job on the Mac, attach from a phone, lock the phone, walk back. The job should still be there, same PTY, journal filled with the minutes you were gone. If it is not, you do not have a pocket surface. You have a pocket owner, and you will fear it.

The phone is a surface. The host holds the shells. Disconnect closes an attachment. It does not end a session. A pocket that owns processes is a second factory, and a second factory is the failure mode.

Code

Where the child lives, and what a pocket event may close·text
TODAY (working contract)
  child / PTY / journal   ->  Mac daemon (or a remote host it already reaches)
  Mac app                 ->  projection
  iOS app                 ->  projection, via tailnet mobile gateway
  iOS local PTY           ->  does not exist

LATER (destination, different tense)
  phone-owned SSH transport, phone-owned keys  ->  Track 8
  not a license to run today's jobs on the phone

pocket event              closes             does not close
lock / suspend / drop     iOS attachment     host session, PTY, child
Mac quit with preserve    Mac projection     host session, PTY, child
operator Close            host session       (this IS the kill)

External links

Exercise

Write three events (phone lock, network drop, operator Close on the Mac pane) and for each name where the child is, and whether it should still be alive. If any of the first two kills the child, rewrite until only Close does. Then write one sentence you would refuse in a design review: "let's just run zsh on the phone for offline."
Hint
Offline on a phone is a destination question, not a reason to move today's compiler into a battery. Close is the only kill in the table.

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.