Architecture
Released (v0.17.0)Available in stable release v0.17.0.
NMSh is a terminal frontend over a persistent real shell session. It intercepts input, provides its own UI for composition and history, and passes execution to a real shell running in a pseudo-terminal (PTY).
The Runtime Path
Section titled “The Runtime Path”- Terminal Host: Your terminal emulator (Ghostty, Terminal.app, WezTerm, etc.) captures keystrokes and renders the cells that NMSh sends it.
- NMSh Frontend: Owns the composer, transcript, menus, and theming. It parses input for syntax highlighting and suggestions, but never executes partial input.
- Session Service (
nmshd): A small background daemon that holds the PTY. This is what allows sessions to detach and reattach. - ShellAdapter: The abstraction layer that translates NMSh commands to the specific shell (zsh, Bash, or Fish) and manages shell state safely.
- Real Shell: The actual
zsh,bash, orfishprocess executing commands.
Invariants
Section titled “Invariants”The NMSh architecture strictly enforces several invariants:
- No replacement shell: NMSh does not reimplement the shell. Job control, parsing, aliases, and environment variables are exactly what your real shell provides.
- Raw output remains raw: PTY output is kept safe. NMSh does not semantically recolor arbitrary PTY output.
- Fullscreen Passthrough: When a program requests the alternate screen or enables mouse reporting (like
vimorhtop), NMSh steps completely out of the way. - Safety boundaries: Theme imports and dotfiles are treated as data, parsed via bounded parsers. Shell config is executable and is never silently modified or sourced.
Supported Platforms
Section titled “Supported Platforms”NMSh is host-independent.
- Operating Systems: macOS (Homebrew/source), Linux (beta), Windows (via WSL 2).
- Terminals: Ghostty and Terminal.app are physically validated. Kitty, iTerm2, WezTerm, and Zed are supported via capability profiles.
- Shells: zsh (default), Bash 4.4+, Fish.