commits
A simple history abstraction that now uses XDG for persisting the
history to a file and loading it during interactive mode.
A first pass implementation of the `trap` built-in. Also, some fixes for
handling the `exit` built-in in terms of what is and what is not a
subshell.
Previously we relied on spawning a long-running [sleep] process in order
to have a process to make the process group leader. The issue was that
Eio was eager to reap child processes but that meant we could not
attach a bunch of processes in a pipeline to the pid of the first
process without race conditions. Now we explicitly allow users to hold
off on reaping children until a promise is resolved.
The initial engine for handling arithmetic expressions. There are plenty
more operators to add, but those shouldn't be too hard. The real
challenge is to fix the shell parser for consuming the expressions, it
is currently broken w.r.t double left parens appearing inside the
expression itself, e.g. $(( ((1 + 1) * 4) )).
The command built-in should allow normal shell built-ins to just work.
Thanks to Ishaan Ghandi's work in
https://github.com/colis-anr/morbig/pull/120, we now have some limited
support for arithmetic expression handling in the shell. Nothing very
extravagant, but workable.
This adds initial functionality for the case compound command.
Switches our use of linenoise to bruit, a port of linenoise to OCaml.
This adds the upstream OCaml community support for reverse search.
Stock linenoise does not have mid-tab completion, we will need to find a
patch somewhere for that.
- Aliasing in Morbig was slightly broken and is now hackily fixed.
- Exporting of environment variables was slightly broken
- Subshell exit codes were not quite right either
It seems many a script uses the shorthand &> to redirect stdout and
stderr at the same time (usually to /dev/null).
This also fixes the problem where the stdout of built-in functions was
just going to the parent stdout instead of respecting things like
pipelines etc.
All of the attributes (remove smallest prefix, parameter length etc.).
This adds a (probably slightly broken) `export` built-in. For now it
only handles the usual case of `export A1=B1 A2=B2`.
Adds simple function application. Also fixes the back to front command
lists!
Slightly better handling of missing commands, could still be a little
better. Especially about when we print the error message.
This needs to plumbed into the actual execution loop itself rather than
catching it at the very last moment!
This renames the shell to msh and adds plenty of package info.
Still very experimental, and hidden behind a [set -o async] flag.
We implement background jobs, however, because of Eio's structured
concurrency we cannot actually stop running the shell and end up waiting
on all the processes in the background!
We add some of the `set -o` capabilities (though unimplemented).
Pipelines need fixing w.r.t built-ins.
A major overhaul of the way that we execute pipelines. Here, we make
sure to add all of the commands to a relevant process group which will
be important for implementing asynchronous jobs later.
Relatively straightforward to implement now that we have so much of the
machinery!
Previously we relied on spawning a long-running [sleep] process in order
to have a process to make the process group leader. The issue was that
Eio was eager to reap child processes but that meant we could not
attach a bunch of processes in a pipeline to the pid of the first
process without race conditions. Now we explicitly allow users to hold
off on reaping children until a promise is resolved.
The initial engine for handling arithmetic expressions. There are plenty
more operators to add, but those shouldn't be too hard. The real
challenge is to fix the shell parser for consuming the expressions, it
is currently broken w.r.t double left parens appearing inside the
expression itself, e.g. $(( ((1 + 1) * 4) )).