Daemon & Sessions
Overview
ori-term keeps shell sessions in a small background process, and the window connects to it over a local socket. The eventual goal is a model where shells survive after you close the window and resume seamlessly when you open it again — without needing a separate multiplexer like tmux running on top.
Process Model
The process_model config field selects how the terminal runs:
process_model = "daemon" # default — connect to (or auto-start) the background process
process_model = "embedded" # single process, no IPC — useful in sandboxes Daemon mode falls back to embedded automatically when the background process cannot be reached.
What Works Today
- Background process for shell sessions — installs alongside the terminal as a separate executable
- Local connection — Unix domain sockets on Linux/macOS, named pipes on Windows
- Auto-start with retry — first launch spawns the background process automatically (3-attempt retry)
- Shell session lifecycle — create, resize, write, read snapshots
- Embedded fallback — single-process mode when the background process is unreachable
Planned
- Multi-window — multiple windows connecting to the same set of running sessions, with the connection protocol hardened for stability across long-running setups
- Auto-save — periodic saves of window positions, tabs, pane layout, and working directories
- Crash recovery — detect unexpected exits and offer to restore the session
- Scrollback archive — disk-backed scrollback that survives restarts
- Remote shells — SSH and WSL panes spawned through the same background process