summaryrefslogtreecommitdiff
path: root/Shell
AgeCommit message (Collapse)Author
2020-08-25Misc: Remove some unneeded includes of Timer.h and ElapsedTimer.h (#3286)Nico Weber
2020-08-22Shell: Add tests for 'if'AnotherTest
2020-08-22Shell: Add 'if' expressionsAnotherTest
```sh if foo bar baz { quux } else if foobar || whatever { echo I ran out of example words } else { exit 2 } ```
2020-08-22Shell: Actually process for loop entries as a streamAnotherTest
This actually does what d4bcc68 meant to do.
2020-08-22Shell: Do not flatten syntactic lists in for_each_entry()AnotherTest
2020-08-22Shell: Mark AST::Background as would_execute if its subnode doesAnotherTest
2020-08-21LibLine: Handle interrupts/window size changes internallyAnotherTest
2020-08-21LibLine: Handle Ctrl-C and Ctrl-D in a way similar to other line editorsAnotherTest
Makes C-c print "^C" and continue prompting on a new line. Also fixes a problem where an interrupted get_line() would need more read()'s than required to update the display.
2020-08-21Shell: Make 'for' loops read their input as an streamAnotherTest
i.e. process an element as it becomes available.
2020-08-19Shell: Do not attempt to yank the TTY from background processesAnotherTest
They don't own the TTY anyway!
2020-08-19Shell: Name the pipe ends correctlyAnotherTest
2020-08-19Shell: Fix outdated debug log codeAnotherTest
2020-08-18Shell: Respect the 'PROMPT_EOL_MARK' environment variableAnotherTest
This allows the users to customise what is shown when a command ends without a newline.
2020-08-18LibLine: Read configuration from a config fileAnotherTest
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: Add some tests for builtin redirectionAnotherTest
2020-08-15Shell: Allow redirections and pipes on builtinsAnotherTest
Fixes #3072.
2020-08-14Shell: Restore input offset when failing to parse a redirectionAnotherTest
This fixes #3051
2020-08-14Shell: Start writing a man pageAnotherTest
This patch adds two man pages describing the parts of the shell that have been so far finalised.
2020-08-13Shell: Add test for 37d5e3e0df6 / #3073Nico Weber
2020-08-12Shell: Add create() factory function for PathRedirectionAndreas Kling
2020-08-12Shell: Fix another FdRedirection reference leakAndreas Kling
Add a create() factory function to prevent this from happening again.
2020-08-12Shell: Wait for the parent to deal with the PGID stuff before execvp()AnotherTest
2020-08-12Shell: Do not assume that the job has exited after unblock in fgAnotherTest
2020-08-12Shell: Eliminate possible use-after-free in builtin_fg()AnotherTest
This fixes a possible UAF where the job might be destroyed in block_on_job().
2020-08-12Shell: Eliminate reference leak in AST::Execute::run()AnotherTest
2020-08-12Shell: Moves pipelined processes to one process groupAnotherTest
2020-08-12Shell: Show the job id instead of the pid when a job exits in backgroundAnotherTest
2020-08-10Shell: Fix fd leak with pipesNico Weber
Fixes the problem reported in #3073. While trying to write a test for this, I thought I'd use Shell -c 'for i in $(seq 100) { echo $i }' | head -n 1 but that makes the cpu spin at 100% and doesn't terminate even with this fix here. But at least piping disasm into head now works.
2020-08-10Shell: Cancel a running for loop upon receiving any non-SIGINT signalAnotherTest
And keep the old behaviour of needing two interruptions on SIGINT.
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-09Shell: Stop a for loop upon receiving two consecutive interruptionsAnotherTest
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-07Shell: Make Command::redirections a NonnullRefPtrVectorAndreas Kling
2020-08-07Shell: Make VariableDeclarations::Variable store NonnullRefPtrsAndreas Kling
2020-08-07Shell: Make resolve_without_cast() return NonnullRefPtr<Value>Andreas Kling
2020-08-07Shell: Store ListValue's values in a NonnullRefPtrVector<Value>Andreas Kling
A ListValue never stores null Values, so it makes sense to restrict it. This also propagates use of NonnullRefPtr to the create() helpers. There's a small bit of awkwardness around the use of initializer_list, since we cannot directly construct a NonnullRefPtrVector from one.
2020-08-07Shell: Add some obvious move() calls in AST constructorsAndreas Kling
2020-08-06LibLine+Shell: Remove unused split_mechanismNico Weber
It was only read in should_break_token(), which had no callers. should_break_token() also got `foo\\ bar` and `"foo bar"` wrong.
2020-08-06Shell: Make "fg" set the TTY PGID before SIGCONT'ing the jobAndreas Kling
Otherwise the child will get SIGTTIN/SIGTTOU on next TTY I/O.
2020-08-06Shell: Print job status after suspending a commandAndreas Kling
2020-08-06Shell: Move printing job status into a Job::print_status() helperAndreas Kling
This is only used by the "jobs" builtin right now, but more soon.
2020-08-06Shell: Remove unnecessary ignore() in Shell::custom_event()Andreas Kling
Ignoring an event means that it will bubble to the parent Core::Object. This is not necessary here.
2020-08-06Shell: Store jobs as NonnullRefPtr<Job>Andreas Kling
2020-08-06Shell: Make Job constructors private and use a create() helperAndreas Kling
Also store PGIDs as pid_t since that's what they are.
2020-08-06Shell: Make run_command() return a NonnullRefPtrVector<Job>Andreas Kling
This never returns null Job pointers.
2020-08-06Shell: Mark suspended children as such when receiving a SIGCHLDAnotherTest
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: Use NonnullRefPtr to simplify some things in the parser/ASTAndreas Kling
2020-08-04Shell: Correct FdRedirection inheriting from two RefCounted basesAnotherTest
Also add missing calls to `adopt()`.