Interrupting
Nothing in heph stops by accident. The two keys that stop things both ask first,
and anything other than y dismisses the question at no cost while the work
continues underneath.
Esc: interrupt the turn
Press Esc while a turn is running:
┌ confirm ──────────────────────────────────────────────────┐
│Interrupt this turn? (y/N) │
└───────────────────────────────────────────────────────────┘
y interrupts. Heph drops the model's stream, or kills the running command's
whole process group, and the turn ends with turn interrupted. What is kept:
-
The text the model had streamed so far.
-
Every edit already made in the worktree, on the private chain.
-
A killed command's abort, recorded as that call's result.
What is dropped: a tool call the model was still sending, since a call without a result cannot be sent back to the model.
An interrupted turn still gets a review if it changed anything. Gates are
skipped, because the work is by definition unfinished, but the review opens, and
what you keep from it is gated before it lands in your tree. If you would rather
look later, Esc out of the review; the change waits in the worktree and the
conversation is marked as waiting
(Picking Up Where You Left Off).
A message sent while a turn runs is queued, never injected; if you want the model to change course, interrupt, then send.
Ctrl-C: abort the tool, keep the turn
Ctrl-C while a command is running asks a narrower question:
Abort the running tool? (y/N)
y kills that command and only it. The model sees aborted by the user as the
command's result and carries on with the turn, which is what you want when a
test run is hanging or a build is going to take longer than you are willing to
wait for. The turn's other work is untouched.
Ctrl-C when no tool is running but a turn is asks to interrupt the turn, like
Esc. When nothing is running, it clears the input.
Ctrl-D: leave
Ctrl-D opens a confirmation, even when nothing is running. Press Ctrl-D
again to leave; any other key cancels. Holding the key does not confirm the exit
when the terminal reports key-repeat events.
With a turn running, the confirmation also warns:
A turn is running. Leave anyway? It is closed as interrupted on the next
start. Press Ctrl-D again to leave; any other key cancels.
The second Ctrl-D cancels the turn and leaves. The next time heph opens this
project, it finds the turn left in flight, closes it as interrupted, and, if the
turn had changed anything, offers its work for review as soon as the
conversation opens.
In a script
heph exec has no one to ask. Ctrl-C (SIGINT) interrupts the turn outright,
and the exit code says so.