Expand description
The shared shell execution core. The shared shell execution core.
The Shell layer is split into a shared core and per-shell shells:
ShellCore — session state, execution machinery, expansion, resolution
├── Bash — bash grammar, bash builtins, bash dialect
└── Zsh — zsh grammar (sh-family subset today), zsh builtins, zsh dialectThe core owns what the shell layer as a whole owns — the
session’s working directory, environment, history, aliases, functions,
the command runtime, word expansion, globbing, redirection, and
resolution (alias → function → builtin → external). It is deliberately
language-agnostic about semantics: the grammar is parsed by each shell,
and builtins are dispatched through a per-shell crate::core::ShellDialect, so a
builtin named echo may (and does) behave differently in Bash than in
Zsh. Mechanisms the shells verified to share (for example cd) live
here as core methods that a shell’s table may delegate to; everything
else is implemented in the shell’s own module.
The grammar today: both shells parse through brush_parser (the
sh-family grammar) — this is a shared substrate, not a Bash-ism. Zsh
owns any future zsh-specific grammar on top of this core.
Structs§
- Name
Resolution - How a name resolves in the shell: the shared precedence walk behind
type,which,where, andwhence. Each shell’s reporter owns the phrasing; this owns the order (alias → function → builtin → PATH). - Shell
Core - The shared session state and execution machinery.
- Shell
Dialect - The per-shell behavior the core depends on: identity, messages, and the builtin table. Each shell constructs its own dialect.
Functions§
- format_
login_ line - Formats a virtual timestamp as a Unix-style “Last login” line, for
example
Fri Aug 21 01:16:56(the macOS convention: weekday, month, day, and clock time, with no year). - hostname_
from_ etc - The virtual host name, read from
/etc/hostnameas root. - needs_
continuation - Returns
truewheninputis an incomplete shell construct that needs more input before it can be executed: an open quote, an unterminated here document, or an unfinished compound command.
Type Aliases§
- Builtin
Runner - How the core dispatches builtins for one shell language.