Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
|
|
This makes --option completions work for pipes and sequences too.
|
|
This makes the completion entry retain information about how much of the
suggestion was part of the string that caused the match.
|
|
Also provide a basic default-constructor.
|
|
In the future all (normal) output should be written by any of the
following functions:
out (currently called new_out)
outln
dbg (currently called new_dbg)
dbgln
warn (currently called new_warn)
warnln
However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)
I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
|
|
|
|
|
|
|
|
Theoretically, this assertion should never trip (at least, on serenity
where we don't really reuse PIDs).
This change should be considered temporary, until we figure out whether
waitpid() is being called twice (and succeeding) for one given PID.
|
|
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.
|
|
|
|
|
|
|
|
The following example should illustrate one issue arising from this:
$ echo 'exit 1' > example.sh
$ Shell example.sh
Good-bye!
This message is meant to be shown to an interactive user, but not in a
shell script.
|
|
This unbreaks aliases!
|
|
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 :^)
|
|
|
|
|
|
This allows the user to break a line:
```sh
$ echo \
foo
```
is the same as
```sh
$ echo foo
```
|