summaryrefslogtreecommitdiff
path: root/Shell/Shell.h
AgeCommit message (Collapse)Author
2020-10-01Shell: Wait for *any* child to change state when receiving a SIGCHLDAnotherTest
This really just works around the core issue, which is that we have no reliable way to know exactly who raised the signal (yet). Fixes #3645, in a very weird (yet apparently standard) way.
2020-09-30Shell: Make 'editor' a member of Shell, and provide a LibShellAnotherTest
2020-09-26Shell: Add live formatting and take an option to enable itAnotherTest
This patchset makes it possible for the shell to format the current buffer of the line editor live, with somewhat accurate cursor tracking. Since this feature is pretty goofy at best, let's keep it off by default for now :^)
2020-09-26Shell: Add a (very basic) formatterAnotherTest
2020-09-15LibCore: Make Core::Object properties more dynamicAndreas Kling
Instead of everyone overriding save_to() and set_property() and doing a pretty asymmetric job of implementing the various properties, let's add a bit of structure here. Object properties are now represented by a Core::Property. Properties are registered with a getter and setter (optional) in constructors. I've added some convenience macros for creating and registering properties, but this does still feel a bit bulky. We'll have to iterate on this and see where it goes.
2020-09-14Shell: Add support for functionsAnotherTest
This implementation does not have support for 'return' yet.
2020-09-14Shell: Add support for $0,$1,...AnotherTest
2020-09-09Shell: Fix event loop processing and backgrounding in subshellsAnotherTest
2020-09-09Shell: Fix job control and backgroundingAnotherTest
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-08-17Shell: Ensure that the cursor starts on a new lineAnotherTest
And print an indicator when it doesn't, a la zsh.
2020-08-15Shell: Allow redirections and pipes on builtinsAnotherTest
Fixes #3072.
2020-08-09Shell: Make redirections without commands apply to all future commandsAnotherTest
This restirects redirection-only commands' scope, and keeps their usefulness too!
2020-08-06Shell: Store jobs as NonnullRefPtr<Job>Andreas Kling
2020-08-06Shell: Make run_command() return a NonnullRefPtrVector<Job>Andreas Kling
This never returns null Job pointers.
2020-08-05Shell: Do not assume that stdin/stdout is a TTYAnotherTest
This closes #2989.
2020-08-04Shell: Give the TTY to the foreground processAnotherTest
This fixes the bug with the shell not waiting for any foreground process that attempts to read from the terminal in the Lagom build.
2020-08-04Shell: Add support for ARGV (and $*, $#)AnotherTest
This patchset also adds the 'shift' builtin, as well as the usual tests. closes #2948.
2020-08-04Shell: factor out updating the path cache into a function.Mathieu PATUREL
2020-08-04Shell: highlight runnable commandsMathieu PATUREL
And display in red the command which will result in something like "no command, or is directory" (inspired by the fish shell).
2020-07-16Shell: Add a 'for' loopAnotherTest
Closes #2760. This commit adds a 'for' loop, and tweaks the syntax slightly to make && bind more tightly than || (allowing for `expr && if_ok || if_bad`) :^)
2020-07-13Shell: Put children in their own process groups and fix job controlAnotherTest
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-13Shell: Move out run_commands and expand_aliases to be Shell member fnsAnotherTest
This makes running commands from outside the AST chain easier.
2020-07-09Shell: Handle signals asynchronouslyTom
Fixes #2717
2020-07-07Shell: Run both /etc/shellrc and ~/.shellrc on startupAndreas Kling
The global script runs before the local (per-user) one.
2020-07-06Shell: Keep the TTY on the same pgroup to get tty signalsAnotherTest
This allows the shell to be notified about SIGWINCH even when a child process is running in the foreground.
2020-07-06Shell: Do not treat the absence of an init script as an errorAnotherTest
2020-07-05Shell: Initial support for 'option' completionsAnotherTest
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-05Shell: Add a 'setopt' builtinAnotherTest
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-05Shell: Provide completions to Tilde and its Juxtaposition.AnotherTest
This commit also removes the ExecutionInputType and directly uses RefPtr<Shell> instead, since nothing else is needed for execution purposes, and also makes the shell refuse to evaluate commands with any sort of syntax error.
2020-07-05Shell: Read and evaluate an init file on startAnotherTest
This behaviour is overridable with the `--skip-init' flag. The default file is at '~/shell-init.sh'
2020-07-05Shell: Add the alias builtin and resolve aliasesAnotherTest
This follows the other shells in alias resolution, and resolves the alias only once.
2020-07-05Shell: Switch to a new parser and ASTAnotherTest
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-05-27Shell: Never assign equal job ids to two different jobsAnotherTest
Since the last job need not have an ID of size()-1, we need to find the max job id and give that+1 out
2020-05-27Shell: Provide some information to inspectorsAnotherTest
2020-05-27Shell: Avoid messing with sigaction while waiting for a childAnotherTest
2020-05-25LibLine: Change get_line to return a Result<String, Error>AnotherTest
This fixes a bunch of FIXME's in LibLine. Also handles the case where read() would read zero bytes in vt_dsr() and effectively block forever by erroring out. Fixes #2370
2020-05-25Shell: Warn the user about active jobs on exitAnotherTest
And make sure that the user means to exit and kill current jobs before exiting.
2020-05-25Shell: Kill existing jobs when exitingAnotherTest
2020-05-25Shell: Add the `disown' shell builtinAnotherTest
2020-05-20LibLine: Unify completion hooks and adapt its usersAnotherTest
LibLine should ultimately not care about what a "token" means in the context of its user, so force the user to split the buffer itself. This also allows the users to pick up contextual clues as well, since they have to lex the line themselves. This commit pacthes Shell and the JS repl to better handle completions, so certain wrong behaviours are now corrected as well: - JS repl can now complete "Object . getOw<tab>" - Shell can now complete "echo | ca<tab>" and paths inside strings
2020-05-17Shell: Treat builtin names as programs and suggest themAnotherTest
2020-05-17Shell: Switch to using Core::EventLoopAnotherTest
This commit refactors Shell to a Core::Object and switches its looping to Core::EventLoop.