terminal: persistent claude sessions + git identity from config.json
Three related improvements to workflow inside ac-native:
1. Persistent PTY sessions (keep claude alive on piece-leave)
terminal.leave() no longer calls system.pty.kill(). The PTY child
lives as long as ac-native is running, so bouncing out to the
prompt and back via `code` re-attaches to the same claude session
instead of cold-starting the CLI every time. Matters because
claude's initial project scan + OAuth handshake + model handshake
takes several seconds, and losing it on every piece swap makes
"check something quickly in the prompt then come back" expensive.
terminal.boot() checks system.pty.active && lastCmd match on
entry; if so it just resizes + clears the grid cache and returns
(no fresh spawn). Fresh spawn only on first entry or after the
PTY child has exited on its own.
2. Plain Escape exits the terminal piece (no kill, no send-to-PTY)
Was passed through as \x1b to claude, which cancels the current
operation there but still left the user stuck in the terminal.
Now esc jumps to prompt directly, PTY stays warm for next visit.
Users who need to send a real ESC byte to claude (e.g. to cancel
a prompt without leaving) can use Ctrl+[ which produces \x1b
through the existing Ctrl+key handler.
3. Git identity + credentials derived from /mnt/config.json
pty.c used to hardcode "Jeffrey Alan Scudder" + "whistlegraph" for
git author + GitHub HTTPS credential helper. Now it reads the
baked config.json handle + email and uses those, falling back to
a generic ac-native / noreply identity only if the config is
unreadable. Paired with a `compush` git alias (add-all + commit
-m + push origin HEAD) so the on-device workflow matches the
repo's CLAUDE.md notation.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>