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

A Phone Hangup Is Not a Kill

~12 min · ios, hangup, attachment, surface, daemon

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

The Pocket Disappears Constantly

A phone locks. A phone suspends. A phone loses the network in an elevator, a tunnel, a kitchen with thick walls. None of those events are an operator saying end the job. They are a surface going away. If the host session treats disappearance as hangup-in-the-POSIX-sense — SIGHUP to the child, shells dying, editors dying — then a pocket terminal is a second owner, and you will never trust it with a long job. You will open it to peek and pay with a massacre.

This lesson is Mac-owned on purpose. The rule has to be true before a phone exists: the daemon owns the fire, an attachment is a subscriber, closing an attachment is not closing a session. The iOS half of this quest — same fire, watch first, gateway, destination — is all commentary on this one sentence. If the sentence is false, those tracks are fiction.

Hangup the Attachment, Not the Job

When the phone locks, suspends, or loses the network, the daemon closes that attachment. The PTY stays. The child stays. The journal keeps filling. The Mac projection, if it is still attached, keeps drawing. A later reconnect from the same phone is a new attachment to the same session, as a spectator unless someone explicitly takes control again. The phone does not get to leave a keyboard behind in the dark.

POSIX hangup is a real signal with a real meaning: the controlling terminal went away, so maybe the job should go away. That meaning is correct for a cable you unplugged from a physical serial port. It is incorrect for a projection you put in a pocket. Smolder has to intercept the metaphor. The controlling terminal, in this design, is the daemon's PTY, not the glass in your hand. The glass can vanish. The PTY does not take that personally.

Load-Bearing for Every Later Track

Watch-first only works if watching cannot kill. Take-control only works if losing control cannot kill. A gateway that drops a device only works if the drop is an attachment close. Direct SSH as a later destination still has to answer the same question on the phone's own transport — but today's working contract, continue-host-work through the gateway, is already lost if a lock is a SIGHUP.

Test this without a phone. Quit the Mac app with preservation. Crash the window. Leave a pane running and walk away. Do not unplug an SSH child to simulate a spectator — that child really dies, and you will misread a working daemon. The jobs should still be there. If they are not, you do not have a daemon. You have a costume, and a pocket surface will inherit the costume's body count.

Lock, suspend, and network loss close an attachment. They do not hang up the job. A surface that can kill by disappearing is a second owner, and a second owner is the failure mode the iOS half exists to refuse.

Code

What a pocket event is allowed to close·text
event                         closes              must not close
-----                         ------              --------------
phone lock                    this attachment     session, PTY, child
phone suspend                 this attachment     session, PTY, child
network loss                  this attachment     session, PTY, child
operator Close on a pane      session + child     (this IS a kill)
operator Detach / quit-keep   projection          session, PTY, child

# After a pocket hangup
  daemon still owns the PTY
  journal still sequences
  reconnect = new attachment, spectator default
  no queued keystrokes
  no replayed Take Control

# The POSIX metaphor, intercepted
  SIGHUP means "controlling terminal gone"
  controlling terminal := the daemon PTY, not the phone glass
  glass gone != controlling terminal gone

External links

Exercise

Write a four-row table: phone lock, phone suspend, network loss, operator Close. For each row, two columns: what closes, what must still be alive. If any of the first three rows kills a child, rewrite until they only close an attachment. Then write one sentence you would put in a review comment if an iOS lifecycle hook called terminate on a session.
Hint
Close is the only row that is allowed to mean death. The other three are the same event wearing different clothes: the glass went away.

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.