Age | Commit message (Collapse) | Author |
|
|
|
Other shells also support a number of other options with exec and
some have special behaviour when calling exec with no arguments except
redirections.
This PR only supports the basic case of replacing the Shell process
(or LibShell host process) with the provided command.
|
|
|
|
This fixes numeric ranges like {1..10}.
|
|
Such errors are raised when SyntaxError nodes are executed, and are also
used for internal control flow.
The 'break' and 'continue' commands are currently only allowed inside
for loops, and outside function bodies.
This also adds a 'loop' keyword for infinite loops.
|
|
Otherwise, a function would, for example, overwrite its parent scope:
```sh
foo(x) { }
x=1
foo 2 # would make x=2 otherwise
```
|
|
This builtin takes a bunch of strings, resolves them as globs (in the
current directory) and prints out the matching entries.
Its main use is to allow dynamic glob resolution:
```sh
glob "$whatever/*"
```
|
|
Fixes #3423.
|
|
Previously, a "subshell" would just be executed in the parent shell.
|
|
This fixes the assert tripping when interrupting a foreground job.
Also make `bg` mark the job as 'should announce exit'.
|
|
Also check for executable permissions before actually trying to run, and
print a helpful message if not executable.
Fixes #4358
|
|
This stops the local socket creation spam.
|
|
Fixes #4345.
This was done in 54b453b in the name of "fixing event loop processing in
subshells", but I do not see how a new PGID is supposed to affect the event
loop.
This seems to have been done by mistake, let's see if any tests fail
because of this.
|
|
|
|
|
|
|
|
"incomplete" meaning that it has a syntax error that can be recovered
from by continuing the input.
|
|
test-case: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28114&q=label%3AProj-serenity
|
|
As found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28109&q=label%3AProj-serenity
|
|
That can happen with too many nested parenthesis, for instance.
This commit sets the maximum allowed limit to 2048 (seems relatively
safe for normal code).
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=28105&q=label%3AProj-serenity
|
|
...in cases where the assert can be directly caused by user input.
|
|
Problem:
- Clang reports unused private member warning in the `Shell::Formatter`.
- Vector is not used in the `Shell::Formatter`.
Solution:
- Remove unused private member variable.
- Remove unused includes.
|
|
|
|
Otherwise, we'll end up overwriting another frame's variables if the
names match up.
|
|
As Vector<T> will relocate objects to resize, we cannot assume that the
address of a specific LocalFrame will stay constant, or that the
reference will not be dangling to begin with.
Fixes an assertion that fires when a frame push causes the Vector to
reallocate.
|
|
This patchset allows a match expression to have a list of names for its
glob parts, which are assigned to the matched values in the body of the
match.
For example,
```sh
stuff=foobarblahblah/target_{1..30}
for $stuff {
match $it {
*/* as (dir sub) {
echo "doing things with $sub in $dir"
make -C $dir $sub # or whatever...
}
}
}
```
With this, match expressions are now significantly more powerful!
|
|
|
|
Assuming we were blocking on one to begin with.
|
|
|
|
|
|
This fixes running `jobs` in a child process.
Also makes sure that stdout is flushed when writing jobs out.
|
|
This makes `Rewiring' much more understandable, and un-confuses the uses
of `dup2()'.
Also fixes `dup2()' bugs.
|
|
e.g. `$(jobs | wc -l)` would blow up horribly otherwise.
(it still does)
|
|
|
|
|
|
This builtin...waits...for the jobs it's given (or all the existing
jobs).
|
|
Previously, `cd` would push relative paths (and possibly nonexistent
ones too) into its history, so `cdh' would fail everywhere else.
|
|
A job might not have its own pgid if it's created through run_tail().
|
|
This allows putting logic in the background as well.
|
|
waitid() *may* be called many times if a job does not exit, so only
assert this fact when the job has in fact exited.
Also allows Background nodes to contain non-execute nodes.
|
|
...and use that to display jobs.
|
|
This allows changing the Shell's history file path.
|
|
This allows us to easily re-use history loading and saving in other
programs using Line::Editor, as well as implementing universally
recognized HISTCONTROL.
|
|
Fixes #3844.
|
|
|
|
This adds support for (basic) brace expansions with the following
syntaxes:
- `{expr?,expr?,expr?,...}` which is directly equivalent to `(expr expr
expr ...)`, with the missing expressions replaced with an empty string
literal.
- `{expr..expr}` which is a new range expansion, with two modes:
- if both expressions are one unicode code point long, the range is
equivalent to the two code points and all code points between the
two (numerically).
- if both expressions are numeric, the range is equivalent to both
numbers, and all numbers between the two.
- otherwise, it is equivalent to `(expr expr)`.
Closes #3832.
|
|
Don't rely on HashTable.h pulling this in.
|
|
|
|
But collapse them to a single empty line.
This makes the generated sources look significantly better.
|
|
|