Age | Commit message (Collapse) | Author |
|
This allows the shell to be notified about SIGWINCH even when a child
process is running in the foreground.
|
|
Normally, this should not happen, as the child should stay around until
we do a waitid on it.
|
|
|
|
Bringing the Serenity Shell to your very own host system :^)
|
|
This behaviour is overridable with the `--skip-init' flag.
The default file is at '~/shell-init.sh'
|
|
|
|
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
|
|
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 changes LibLine's internal structure to work in an event
loop, and as a result, also switches it to being a Core::Object.
|
|
* 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.
|
|
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 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.
|
|
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.
|
|
|
|
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.
|
|
...when no matching executable could be found in $PATH
|
|
|
|
|
|
|
|
With extra color (tm)
This commit also patches the users of LibLine to properly use the new
API
|
|
|
|
|
|
|
|
This moves the Termios logic inside LibLineEdit and allows users to
simply forget about the existence of termios if they so choose to :^)
|
|
This allows the LineEditor to get notified about signals, since we
cannot set signal handlers in a clean way within the LineEditor
instance.
|
|
This builds up on the 'new' LibLineEdit and overrides some of its hooks
For instance, on_tab_complete_first_token
|
|
The "\w" substitution in shell prompts now uses '~' to represent the
user's home directory (technically, whatever $HOME contains.)
|
|
\0 pointed out that it's pretty bad to have world-readable .history
files, especially for root's shell!
|
|
Now expanding a tilde isn't hardcoded to just work for `cd`. It is instead
expanded while processing shell arguments. Autocompletion still doesn't
work, but this is definitely an improvement over the last iteration.
|
|
This reads a little nicer, and makes us care less about an empty String
|
|
We missed this when switching to size_t for vector sizing as this
code is not normally compiled.
|