Open nixpulvis opened 6 years ago
Started in b78ae21e8a059ec5e7d355cdda91292264ec824c
The syntax seems to all be correctly parsing now, and I'm pretty sure I'm happy about background jobs owning a Command
and not a Program
.
Going to try and sort this out on job-exec-ohmy
.
The implementation at the moment seems to work quite well (at least in the basic cases I hand tested), however I'm aware of some shortcuts I've taken. For example, background compound statements, e.g. Background(Compound(vec![A, B]))
should run A
then B
as a process group together in a single background job.
For example try:
{ echo 1; sleep 2; echo 2; }
I would guess that the solution to this will be related to the solution to #58.
We need to support the basic
fg
,bg
, andjobs
,wait
commands, background syntax&
, and the signalSIGTSTP
typically invoked via ctrl-z.The
disown
command is standard in Bash, but I'm not sure how I feel about it yet.The main design work here is going to be around the needed event loop / threading to properly track and manage background jobs while the main shell is running. I suppose a single threaded solution exists, but I doubt it's a good idea.