This shell should be both POSIX compatible and yet modern and exciting. Fancy features should not be prevented by POSIX compatibility. This will effect the design of the shell.
The name of the shell is
oursh which is both somewhat unique, and
memorable. It’s also a nice name to play with pseudo-satirical themes…
right comrade? It’s short (ish) and sneakily fits
rs in it, which is the
extension of Rust programs, the language this will be written in.
- Sane defaults
See the following sections for building the POSIX
sh compliant program
language, and interactive terminal based REPL. While this mainly defines the
posix module, there are a lot of common concepts to all
- 3§2 Shell Command Language
- 10.2 Shell Grammar Rules
- 2§2.5 Standard I/O Streams
- 3§1.6 Built-In Utilities
- 3§1.4 Utility Description Defaults
- 2§2.3 Error Numbers
- 1§11 General Terminal Interface
- 2§2.4 Signal Concepts
This shell will be written in Rust with minimal dependencies. Notably
libc will likely be used. The parsing library will be
lalrpop, which should support the syntax we want somewhat easily, though
grammar’s in general can be a tricky beast.
We will want to create a few internal modules for the shell.
This design is subject to change.
process- sub-process execution management.
program- parser and interpreter for the syntax of the shell.
posix- POSIX (
modern- Modified syntax for supporting “modern” features, like lambdas.
repl- syntax aware, read eval print loop for an underlying terminal.
history- records previous execution to a shared DB.
completion- searches for autocompletions based on partial syntax.
bash- bash completion support.
zsh- zsh completion support.
parse- dynamic completion generation, from
sync- remote session and DB synchronization.
invocation- loading for
package- simplistic package manager support (builtin function).
- Subprocess execution management.
- Parsing and handling program syntax(es) of the shell.
- Quick and effective raw mode repl library for ANSI terminals.
- Print debug information to stderr.