Commit Graph

10 Commits

Author SHA1 Message Date
AnotherTest
cd8495f1d4 Shell: Explicitly declare 'environ' to make the macOS Lagom build happy 2020-07-15 00:09:01 +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
7170df7dd8 Shell: Resolve aliases in builtin_time 2020-07-13 15:12:28 +02:00
AnotherTest
ff857cd358 Shell: Initial support for 'option' completions
Take one small step towards #2357.
Handle completing barewords starting with '-' by piping the requests to
the Shell::complete_option(program_name, option) :^)

Also implements completion for a single builtin (setopt) until we figure out how
to handle #2357.
2020-07-05 15:43:14 +02:00
AnotherTest
b8d1edb2a2 Shell: Add a 'setopt' builtin
This builtin sets (and unsets) boolean flags that alter the behaviour of
the shell.
The only flags added are
- inline_exec_keep_empty_segments: Keep empty segments in the result of
  splitting $(...) by $IFS
- verbose: Announce each command before executing it

It should be noted that the (rather extreme) verbosity of the names is
intentional, and will hopefully be alleviated by the next commit :^)
2020-07-05 15:43:14 +02:00
AnotherTest
639c1a1737 Shell: Build as part of Lagom as well
Bringing the Serenity Shell to your very own host system :^)
2020-07-05 15:43:14 +02:00
AnotherTest
16def040af Shell: Do not try to recreate a command from a list of args in time
Shell already provides a run_command(AST::Command) which can be
constructed from a list of arguments, use that instead.
2020-07-05 15:43:14 +02:00
AnotherTest
2915dcfcc3 Shell: Add the alias builtin and resolve aliases
This follows the other shells in alias resolution, and resolves the
alias only once.
2020-07-05 15:43:14 +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