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

Close Ends, Detach Keeps

~11 min · close, detach, preservation, verbs, daemon

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

Two Verbs, Two Intents

Closing a pane is I am done with this job. Quitting the app with preservation on is I still want the jobs. If those verbs mean the same thing, you cannot leave a terminal. Lunch becomes a death sentence. A window becomes a hostage. You start treating quit as a last resort instead of a walk-away, which is how a daily driver turns into furniture you are afraid to move.

A glued-together GUI terminal usually has one verb: quit. Quit ends the factory, so it ends the shells. tmux taught a generation a workaround — detach from the multiplexer, leave the multiplexer running, come back later. The workaround is real. It is also the seam from the first track: you own neither program, and the pane is a rectangle in a byte stream. Smolder keeps the lesson and throws away the seam. Close and detach are first-class verbs on an owned pane, not folklore you type into someone else's multiplexer.

What Close Actually Leaves Behind

Close terminates and reaps the owned jobs. It does not pretend the process is still there. What it keeps is a bounded reopen declaration: host, command, directory, split geometry — a recipe, not a PID. The bound matters. An unbounded "recently closed" list is a graveyard that pretends it is a resume queue. A bounded list is an honest memory: you can bring the layout back as new processes, and you cannot accidentally believe last Tuesday's compiler is still compiling.

That declaration is the same kind of object a later track will call an arrangement. Close is how a live job becomes a declaration. Detach is how a live job stays a live job while the projection vanishes. Mixing those two leftovers — a recipe and a running process — is how restore starts lying about what is alive.

Detach Is Quit With Preservation

Quit with preservation on is detach. The Mac app goes away. The daemon keeps the PTYs. The journal keeps filling. A later attach — same Mac, or a phone — is a projection coming back to a fire that did not notice. A crash of the app is the same shape, if the daemon is still up. A crash of the daemon is not detach; process identity is gone, and restore will rematerialize declarations, which is the next lesson, not this one.

The verbs have to differ in the UI, in the menus, in the shortcuts, and in the logs. A menu that says Close and then detaches is a lie. A quit that kills jobs while a checkbox somewhere promised preservation is a lie with extra steps. Name them, show them, and let the operator pick. A family that cannot say "end this" versus "keep this while I walk away" will never trust a pocket surface with a long job.

Close ends a job. Detach keeps it. If the verbs collapse, the terminal becomes unsafe to leave, and every later surface — including a locked phone — inherits that unsafety.

Code

Same pane, two verbs, two leftovers·text
# CLOSE a pane
  terminate the owned process group
  reap it
  keep a bounded reopen declaration:
    host, command, directory, split geometry
  leftover = recipe, not PID
  reopen later = NEW processes from that recipe

# DETACH (quit with preservation)
  projection goes away (window, app, crash of the app)
  daemon keeps the PTYs
  journal keeps filling
  leftover = the live jobs
  attach later = same processes, same fire

# Illegal collapses
  Close that leaves the process running     = lying Close
  Quit that kills jobs after "preserve"     = lying Detach
  Unbounded recently-closed as resume queue = graveyard dressed as live

External links

Exercise

Write two sentences you would be willing to put on a menu: one for close, one for quit-with-preservation. Then, for each sentence, name the leftover: a recipe, a live process, or a lie. If either leftover is a lie, rewrite the sentence until the leftover is one of the first two.
Hint
If a newcomer could not tell which sentence kills the compiler, the verbs have already collapsed. The leftover has to be sayable in one noun.

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.