Commit Graph

13 Commits

Author SHA1 Message Date
AnotherTest
715e11f692 Shell: Fix job control and backgrounding
This patchset makes the shell capable of lazily resolving and executing
sequences of commands, to allow for putting logical sequences in the
background.
In particular, it enables And/Or/Sequence nodes to be run in the background,
and consequently unmarks them as `would_execute`.
Doing so also fixes job control to an extent, as jobs are now capable of
having 'tails', so sequences can be put in the background while
preserving their following sequences.
2020-09-09 20:35:21 +02:00
AnotherTest
cf18bff72a Shell: Do not attempt to yank the TTY from background processes
They don't own the TTY anyway!
2020-08-19 21:21:34 +02:00
AnotherTest
2b51250863 Shell: Wait for the parent to deal with the PGID stuff before execvp() 2020-08-12 11:41:18 +02:00
AnotherTest
ab3e787334 Shell: Moves pipelined processes to one process group 2020-08-12 11:41:18 +02:00
AnotherTest
5ae2f6e9ec Shell: Stop a for loop upon receiving two consecutive interruptions
This does not work perfectly (just like every other shell...), if the
running program handles the signal (SIGINT in this case) and quits
cleanly, the shell cannot detect the interruption.
This is the case with our `sleep(1)`.
2020-08-09 21:08:07 +02:00
Andreas Kling
22dd5a7021 Shell: Move printing job status into a Job::print_status() helper
This is only used by the "jobs" builtin right now, but more soon.
2020-08-06 15:09:49 +02:00
Andreas Kling
5bce0193de Shell: Make Job constructors private and use a create() helper
Also store PGIDs as pid_t since that's what they are.
2020-08-06 13:48:45 +02:00
AnotherTest
dc62371439 Shell: Avoid waiting for jobs that were *just* unblocked
This fixes the issue with C-z not suspending the job on the first try.
...and further signal issues when the suspended job is contiued.
2020-07-13 19:48:45 +02:00
AnotherTest
151e4d41ed Shell: Put children in their own process groups and fix job control
This commit fixes job control by putting children in their own process
group, and proxying TTY signals to active jobs.
This also cleans up the code around builtin_disown a bit to use
the newer job interfaces.
2020-07-13 15:29:16 +02:00
AnotherTest
a4627f2439 Shell: Switch to a new parser and AST
This commit also completely reworks the execution, highlighting and
completion model to work with the new AST.
New additions:
- $(...) stdout captures
- fd>&fd redirections
- fd>&- redirections (close fd)
- read-write redirections (<> path)
- completely event-based execution
- the weird idea of allowing the user to redirect the shell's own fds
- variables in strings
- local variables
- minimal list support
- adding hyperlinks to all paths that exist
2020-07-05 15:43:14 +02:00
AnotherTest
0d39418b0b Shell: Add the `disown' shell builtin 2020-05-25 00:08:32 +02:00
AnotherTest
a398898c12 Shell: Switch to using Core::EventLoop
This commit refactors Shell to a Core::Object and switches its looping
to Core::EventLoop.
2020-05-17 11:58:08 +02:00
AnotherTest
e630d83633 Shell: Add job control capabilities
This patchset adds the `jobs`, `fg` and `bg` builtins.
2020-05-17 11:58:08 +02:00