Age | Commit message (Collapse) | Author |
|
We were getting a little overly memey in some places, so let's scale
things back to business-casual.
Informal language is fine in comments, commits and debug logs,
but let's keep the runtime nice and presentable. :^)
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
|
|
This commit makes LibLine handle interrupts (as reported via
interrupted() and resized()) again.
There is a little catch with the shell:
```
$ ls |
pipe> <C-c> (prompt stays here until a key is pressed)
```
|
|
|
|
This commit allows the Shell to complete paths in redirections.
A closing quote is added if the path is an unclosed quote.
```
$ foo > "foob<tab>
$ foo > "foobar"
```
|
|
|
|
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
|
|
|
|
|
|
This commit changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
* In some cases, we can first call sigaction()/signal(), then *not* pledge
sigaction.
* In other cases, we pledge sigaction at first, call sigaction()/signal()
second, then pledge again, this time without sigaction.
* In yet other cases, we keep the sigaction pledge. I suppose these could all be
migrated to drop it or not pledge it at all, if somebody is interested in
doing that.
|
|
Suspending the shell while interacting with it is pretty weird, so let's
just disallow this behaviour.
|
|
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
|
|
And make sure that the user means to exit and kill current jobs before exiting.
|
|
This commit adds the InBackground and ShortCircuitOnFailure attributes
to commands, which respectively cause the command to be run in the
background, and abort the command chain with exit status != 0.
|
|
|
|
|
|
Prior to this, we did not care if there was any whitespace after the
last token in the prompt, and this caused a regression:
```
> lsp <tab>
> lsp ci
```
|
|
To achieve this, the API was tweaked a bit to allow for easier tracking
of completions.
This API change is non-disruptive to any application that does not use
anchored styles.
|
|
```
ls ./Ter<tab>
```
gets you a link to ./Terminal.ini, right in the prompt.
|
|
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
|
|
This commit also fixes a problem with us throwing out data that was
inserted while a command was running.
|
|
|
|
We were missing two characters at the end due to a mix-up when skipping
over the first two characters ("#!")
|
|
This commit refactors Shell to a Core::Object and switches its looping
to Core::EventLoop.
|
|
The remaining one is 'pushd', which seems to have relatively complex
logic with regards to its arguments.
|
|
This patchset adds the `jobs`, `fg` and `bg` builtins.
|
|
In the case of a syntax error the shell parser prints an error message
to stderr and returns an empty Vector<Command> - in that case we
shouldn't try to determine whether or not we can continue parsing but
abort immediately - is_complete() expects that *something* was parsed
successfully.
Fixes #2251.
|
|
|
|
Prior to this, we would only wait for program exit; the shell should
stop waiting once the program has been stopped.
Fixes #2230
|
|
Amusingly enough, this was caused by yet another bug.
|
|
Closes https://github.com/SerenityOS/serenity/issues/2080
|
|
This fixes the little issue with Shell not allowing cancellation of
commands once they were in continuation mode
```
$ ls '
$ # No matter what we do here, we cannot escape 'ls'
```
|
|
|
|
|
|
|
|
This patchset adds some metadata to Parser::parse() which allows the
Shell to ask for the rest of a command, if it is not complete.
A command is considered complete if it has no trailing pipe, or
unterminated string.
|
|
|
|
|
|
This patchset fixes incorrect handling of escaped tokens (`a\ b`) in
Shell autocompletion and LibLine.
The users of LibLine can now choose between two token splitting modes,
either taking into account escapes, or ignoring them.
|
|
This commit fixes the (incorrect) behaviour of treating quotes as part
of the redirection filename.
Fixes #1857 :^)
|
|
|
|
Userland/hostname: Now takes parameter to set the hostname
LibC/unistd: Added sethostname function
|
|
It was impractical to return a RefPtr<File> since that left us no way
to extract the error string. This is usually needed for the UI, so the
old static open() got basically no use.
|
|
|
|
These strings would be applied when inserted into the buffer, but are
not shown as part of the suggestion.
This commit also patches up Userland/js and Shell to use this
functionality
|
|
|
|
This is a bit nicer than getting "Exec format error" after trying to
execvp() a directory.
|