commits
Has been added both as a `.` and as the word `source`.
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!
Unfortunately this work got complicated quickly and resulted in more
fixes and features than I wished. Primarily, we now have subshell
support. This also meant rejigging how we expand and collect variable
assignments. There is a new, rather janky, concept of local_state which
is something we clear immediately after executing a command. This might
need some more work in the future.
Using glob(3) this adds simple glob support. I'm sure this isn't
sufficient for all of the pattern-matching that is possible in POSIX
shell's, but it is a good start.
This introduces a `'a Exit.t` type for handling exit codes during the
execution of a series of commands. This is useful because unlike a
`Result.t` a non-zero exit code does not always mean _unrecoverable
error_.
We create the infrastructure necessary to support shell built-ins. The
built-ins `cd` and `pwd` are added and lightly tested.
We disable all the necessary flags (and restore them) for entering
raw mode!
Shells are always more fun when there is an interactive mode to play
around with. Here we vendor Shelter's ANSI-ready copy of ocaml-linenoise
and add a simple interactive loop to osh!
Commands separated by newlines or semicolons will now be executed
sequentially. The logic for commands that exit with non-zero exit codes
will still need some close work.
This logic also comes with a vendoring of the inherit_fds logic too.
See the corresponding issue on Eio's page: https://github.com/ocaml-multicore/eio/issues/826
Substitute the default FDs into the various redirection operators.
Has been added both as a `.` and as the word `source`.
Unfortunately this work got complicated quickly and resulted in more
fixes and features than I wished. Primarily, we now have subshell
support. This also meant rejigging how we expand and collect variable
assignments. There is a new, rather janky, concept of local_state which
is something we clear immediately after executing a command. This might
need some more work in the future.