Commit graph

10963 commits

Author SHA1 Message Date
Nico Weber
0d851b1930 Add manpages for posix_spawn 2020-07-06 10:01:14 +02:00
Tom
9725bda63e Kernel: Enhance WaitQueue to remember pending wakes
If WaitQueue::wake_all, WaitQueue::wake_one, or WaitQueue::wake_n
is called but nobody is currently waiting, we should remember that
fact and prevent someone from waiting after such a request. This
solves a race condition where the Finalizer thread is notified
to finalize a thread, but it is not (yet) waiting on this queue.

Fixes #2693
2020-07-06 10:00:24 +02:00
Tom
2a82a25fec Kernel: Various context switch fixes
These changes solve a number of problems with the software
context swithcing:

* The scheduler lock really should be held throughout context switches
* Transitioning from the initial (idle) thread to another needs to
  hold the scheduler lock
* Transitioning from a dying thread to another also needs to hold
  the scheduler lock
* Dying threads cannot necessarily be finalized if they haven't
  switched out of it yet, so flag them as active while a processor
  is running it (the Running state may be switched to Dying while
  it still is actually running)
2020-07-06 10:00:24 +02:00
Tom
49f5069b76 Kernel: Add a SpinLock to the WaitQueue
We need to be able to prevent a WaitQueue from being
modified by another CPU. So, add a SpinLock to it.

Because this pushes some other class over the 64 byte
limit, we also need to add another 128-byte bucket to
the slab allocator.
2020-07-06 10:00:24 +02:00
Tom
788b2d64c6 Kernel: Require a reason to be passed to Thread::wait_on
The Lock class still permits no reason, but for everything else
require a reason to be passed to Thread::wait_on. This makes it
easier to diagnose why a Thread is in Queued state.
2020-07-06 10:00:24 +02:00
Andreas Kling
0c4b0c0312 Terminal+LibVT: Add "clear including history" action (Ctrl+Shift+K) :^)
Sometimes you just want to get rid of all your scrollback history in
the terminal, and now there's a way to do that.
2020-07-05 23:34:02 +02:00
Andreas Kling
e8a59ef842 DisplaySettings: Fix crash on exit (due to Core::Object on the stack) 2020-07-05 21:17:14 +02:00
Andreas Kling
244fe1089c LibWeb: Use LayoutTableRowGroup for display:table-{header,footer}-group 2020-07-05 19:51:49 +02:00
Andreas Kling
6b3a7b1ce7 Base: Add man pages for gettid(), getpid(), and getppid() 2020-07-05 19:37:43 +02:00
Andreas Kling
d4fe3e8009 LibWeb: Always fire the link hover hooks when moving between links
Some broken logic was preventing us from firing the hover hooks when
the cursor jumped directly from one link to another.
2020-07-05 17:05:23 +02:00
Andreas Kling
63d796312d LibWeb: Tweak PageView::on_link_hover hook
Change: on_link_hover(String) -> on_link_hover(URL)

Also, we now fire the hook when a link is unhovered as well, allowing
the embedder to react to nothing being hovered anymore.
2020-07-05 17:02:44 +02:00
Andreas Kling
58b1ba2545 WebContent: Plumb hovered links from WebContent process over to widget
Also add a little GUI::StatusBar to the demo app so we can see the
hovered link URL's live. :^)
2020-07-05 16:59:20 +02:00
Andreas Kling
aac362b883 WebContent: Put some debug spam behind an #ifdef
This makes resizing the window a little less obnoxious. :^)
2020-07-05 16:49:40 +02:00
Andreas Kling
2c4a168404 AK: Remove debug spam in SharedBuffer::create_from_shbuf_id() 2020-07-05 16:36:28 +02:00
Andreas Kling
554b58d85f WebContent: Add double buffering to the WebContentView
This removes the remaining flicker in the WebContentView widget and
makes it feel pretty good to use it. :^)

The increase in memory use is something we'll have to address in the
future with more sophisticated solutions like tiling, etc.
2020-07-05 16:33:33 +02:00
Andreas Kling
668fe61b1d WebContent: Coalesce pending paint events to reduce overdraw
Instead of painting synchronously whenever a Paint request comes in,
the WebContent process will now buffer pending paints and coalesce
them and defer the actual paint using a zero-timer.

This significantly reduces flickering already, without doing any
double-buffering in the WebContentView widget.
2020-07-05 16:26:15 +02:00
AnotherTest
ddbdd0e686 Shell: Do not remove more than 2 dashes from the option being completed
This makes '------inl' a completion request for an option named
'----inl' instead of 'inl'.
2020-07-05 16:11:49 +02:00
Nico Weber
9cc32d6e95 Userland+MenuApplets: Replace two more fork/exec with posix_spawn 2020-07-05 16:03:23 +02:00
Andreas Kling
131bc8fd31 WebContent: Plumb scroll-into-view requests from server to client
The WebContentView widget will now be able to react to scroll-into-view
requests from the WebContent process.
2020-07-05 15:57:07 +02:00
Andreas Kling
56d14d5701 LibWeb: Move fragment link handling to Frame
Activating a "#foo" fragment link will now be handled internally by
the Frame instead of involving the widget layer.

If the viewport needs to be scrolled as a result, we will simply ask
the PageClient to scroll a new rect into view.
2020-07-05 15:57:07 +02:00
AnotherTest
2b80a45f82 Meta: Do not run shellcheck on our Shell's scripts 2020-07-05 15:43:14 +02:00
AnotherTest
3a072332f4 Shell: Add some tests 2020-07-05 15:43:14 +02:00
AnotherTest
ff857cd358 Shell: Initial support for 'option' completions
Take one small step towards #2357.
Handle completing barewords starting with '-' by piping the requests to
the Shell::complete_option(program_name, option) :^)

Also implements completion for a single builtin (setopt) until we figure out how
to handle #2357.
2020-07-05 15:43:14 +02:00
AnotherTest
b8d1edb2a2 Shell: Add a 'setopt' builtin
This builtin sets (and unsets) boolean flags that alter the behaviour of
the shell.
The only flags added are
- inline_exec_keep_empty_segments: Keep empty segments in the result of
  splitting $(...) by $IFS
- verbose: Announce each command before executing it

It should be noted that the (rather extreme) verbosity of the names is
intentional, and will hopefully be alleviated by the next commit :^)
2020-07-05 15:43:14 +02:00
AnotherTest
d6de2b5828 Shell: Show descriptions about syntax errors
The description contains an error message and where in the source the
error happened.
2020-07-05 15:43:14 +02:00
AnotherTest
034be8e74c Shell: Allow a command sequence to be delimited by newlines 2020-07-05 15:43:14 +02:00
AnotherTest
639c1a1737 Shell: Build as part of Lagom as well
Bringing the Serenity Shell to your very own host system :^)
2020-07-05 15:43:14 +02:00
AnotherTest
d2bdbc3e77 Shell: Mark And and Or nodes as execute nodes 2020-07-05 15:43:14 +02:00
AnotherTest
3a37e8c56f Shell: Provide completions to Tilde and its Juxtaposition.
This commit also removes the ExecutionInputType and directly uses
RefPtr<Shell> instead, since nothing else is needed for execution
purposes, and also makes the shell refuse to evaluate commands with
any sort of syntax error.
2020-07-05 15:43:14 +02:00
AnotherTest
c5d0aa9a44 Shell: Allow commands in variables, and properly substitute them on use
This allows the below interaction to work:
```
$ silence=(2>&1 >/dev/null)
$ do_noisy_thing with these args $silence
<nothing here lol>
```
2020-07-05 15:43:14 +02:00
AnotherTest
42304d7bf1 Shell: Parse a pipe sequence inside $(...) 2020-07-05 15:43:14 +02:00
AnotherTest
8e078cf4ab Shell: Expand Juxtaposition of lists to list products
This commit makes `echo x(foo bar)` create an argv of `echo xfoo xbar`,
essentially modeling brace expansions in some shells.
2020-07-05 15:43:14 +02:00
AnotherTest
16def040af Shell: Do not try to recreate a command from a list of args in time
Shell already provides a run_command(AST::Command) which can be
constructed from a list of arguments, use that instead.
2020-07-05 15:43:14 +02:00
AnotherTest
bc3285abb0 Shell: Read and evaluate an init file on start
This behaviour is overridable with the `--skip-init' flag.
The default file is at '~/shell-init.sh'
2020-07-05 15:43:14 +02:00
AnotherTest
3d6a035d0f Shell: Use ArgsParser for argument parsing 2020-07-05 15:43:14 +02:00
AnotherTest
2915dcfcc3 Shell: Add the alias builtin and resolve aliases
This follows the other shells in alias resolution, and resolves the
alias only once.
2020-07-05 15:43:14 +02:00
AnotherTest
a4627f2439 Shell: Switch to a new parser and AST
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
2020-07-05 15:43:14 +02:00
AnotherTest
6f7ac5d2e2 LibCore: Stop select()'ing after an interrupt if a quit was requested
This allows signal handlers to request the loop to terminate.
2020-07-05 15:43:14 +02:00
Kevin Meyer
0f6c5783d3
WebContent: Use available size for bitmap (#2701)
After adding the scrolling feature, content available space reduced and
thus the bitmap size was always larger, than the inner size.
This lead to the horizontal scrollbar always beeing engaged.
2020-07-05 12:45:56 +02:00
Sergey Bugaev
a8489967a3 Kernel: Add Plan9FS :^)
This is an (incomplete, and not very stable) implementation of the client side
of the 9P protocol.
2020-07-05 12:26:27 +02:00
Sergey Bugaev
187b785a05 Kernel: Split BlockBasedFileSystem off FileBackedFileSystem
FileBackedFileSystem is one that's backed by (mounted from) a file, in other
words one that has a "source" of the mount; that doesn't mean it deals in
blocks. The hierarchy now becomes:

* FS
  * ProcFS
  * DevPtsFS
  * TmpFS
  * FileBackedFS
    * (future) Plan9FS
    * BlockBasedFS
      * Ext2FS
2020-07-05 12:26:27 +02:00
Sergey Bugaev
0c72a9eda7 Kernel: Fix .. directory entry at mount point handling a little
It's still broken, but at least it now appears to work if the file system
doesn't return the same inode for "..".
2020-07-05 12:26:27 +02:00
Sergey Bugaev
3645b9e2a6 Kernel: Make sure to drop region with interrupts enabled
A region can drop an inode if it was mmaped from the inode and held the last
reference to it, and that may require some locking.
2020-07-05 12:26:27 +02:00
Sergey Bugaev
6111cfda73 AK: Make Vector::unstable_remove() return the removed value
...and rename it to unstable_take(), to align with other take...() methods.
2020-07-05 12:26:27 +02:00
Sergey Bugaev
63f458ffc1 Kernel: Fix KBufferBuilder::append()
insertion_ptr() already includes the offset.
2020-07-05 12:26:27 +02:00
Andreas Kling
c15f9e7593 WebContent: Plumb title changes over to the WebContentView
WebContentView now fires its on_title_change hook, like Web::PageView.
We use this in the WebView test app to update the window title. :^)
2020-07-04 23:40:17 +02:00
Andreas Kling
7cb7bcb924 WebContent: Illustrate multi- vs single-process diffs in documentation 2020-07-04 23:34:12 +02:00
Andreas Kling
cb3287597d WebContent: Give the WebContentView a proper GUI::Frame look :^) 2020-07-04 23:27:36 +02:00
Andreas Kling
8914e945cb WebContent: Translate mouse event coordinates into content space
The WebContentView widget now passes content space coordinates along
with the various mouse events. :^)
2020-07-04 23:23:36 +02:00
Andreas Kling
e91871aed7 WebContent: Basic scrolling support! :^)
The WebContentView widget now inherits from GUI::ScrollableWidget and
will pass its scroll offset over to the WebContent process as it's
changing. This is not super efficient and can get a bit laggy, but it
will do fine as an initial scrolling implementation.

Just like the single-process Web::PageView widget, WebContentView also
paints scrolled content by translating the Gfx::Painter.
2020-07-04 23:19:32 +02:00