Commit graph

13414 commits

Author SHA1 Message Date
Tom
bb92eab9ce AK: Add is_trivial and is_trivially_copyable 2020-10-02 15:38:07 +02:00
Linus Groh
91bcad7cce Base: Add missing options to the Shell(1) man page 2020-10-02 14:40:54 +02:00
asynts
ba3488a6d5 UserspaceEmulator: Replace printf usages with format.
This replaces almost all usages. Some have to remain because 'outf'
always appends a newline. (It inherits this behaviour from LogStream.)
2020-10-02 13:44:42 +02:00
asynts
fb7a94c959 AK: Add formatter for pointer types. 2020-10-02 13:44:42 +02:00
asynts
ebafc5b4d2 AK: Add formatter for boolean values. 2020-10-02 13:44:42 +02:00
utku
7e9cd8a860
Keymaps: Add Colemak keymap (#3658)
Leave CapsLock as is, as the Colemak Windows driver also does
(Colemak originally maps CapsLock as Backspace).
2020-10-02 13:44:16 +02:00
Tibor Nagy
18c67b4002 LibGUI: Fix 1px misalignment of ColorButton selections in ColorPicker
Also use shrunken() to calculate the selection rects.
2020-10-02 13:08:32 +02:00
zilrich
a2ffe95a8c
Meta: Update OpenSUSE build dependencies (#3655) 2020-10-02 13:08:06 +02:00
AnotherTest
254d66cd81 Shell: Assert that the same pid is not given to waitpid()
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.
2020-10-01 21:20:14 +02:00
AnotherTest
519d1811fd Shell: Wait for *any* child to change state when receiving a SIGCHLD
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.
2020-10-01 21:20:14 +02:00
AnotherTest
a7828434c0 Shell: Sneak a way into being a session leader 2020-10-01 21:20:14 +02:00
Tibor Nagy
422cb50e4e Userland: Fix buffer overflow in unzip
It's not a great idea reading file names into a 4 byte sized buffer.
2020-10-01 21:15:35 +02:00
Andreas Kling
bd5abbc454 LibJS: Fix fatal mistake in HeapBlock::cell_from_possible_pointer()
When scanning for potential heap pointers during conservative GC,
we look for any value that is an address somewhere inside a heap cell.

However, we were failing to account for the slack at the end of a
block (which occurs whenever the block storage size isn't an exact
multiple of the cell size.) Pointers inside the trailing slack were
misidentified as pointers into "last_cell+1".

Instead of skipping over them, we would treat this garbage data as a
live cell and try to mark it. I believe this is the test-js crash that
has been terrorizing Travis for a while. :^)
2020-10-01 21:07:12 +02:00
Andreas Kling
0245e0f03a DevTools: Remove VisualBuilder and FormCompiler
This functionality is being moved to HackStudio so let's not confuse
people by keeping the old stuff around.
2020-10-01 21:07:12 +02:00
Andreas Kling
6c9a3ecf42 LibIPC: Silence a warning when compiling with gcc -O0 2020-10-01 19:16:35 +02:00
Itamar
a39c4cc340 HackStudio: Integrate with C++ Language Server
Editors now communicate with the c++ language server when openning and
editing c++ source files, and go through the language server to get
autocomplete suggestions.
2020-09-30 21:46:59 +02:00
Itamar
863f14788f HackStudio: Add C++ Language Server
The language server keeps track of the content of currently edited
files by receiving updates about edit actions.

Also, C++ autocompletion is no longer tied to HackStudio itself and
moved to be part of the language server.
2020-09-30 21:46:59 +02:00
Itamar
bf53d7ff64 LibCpp: Add library for working with c++ code
Moved the C++ Lexer we have from LibGUI to here, so that other
components could use it without linking with LibGUI.
2020-09-30 21:46:59 +02:00
Itamar
fec4152220 LibCore: Add ensure_parent_directories to LibCore::File
Moved the implementation in SystemServer/Service.cpp to LibCore.
2020-09-30 21:46:59 +02:00
AnotherTest
c1fc27cab2 HackStudio+TextEditor: Add the Shell syntax highlighter 2020-09-30 20:05:24 +02:00
AnotherTest
72b68221cc LibGUI: Add a Shell syntax highlighter 2020-09-30 20:05:24 +02:00
AnotherTest
a10cfee0d4 Shell: Track line numbers and the positions of some keywords 2020-09-30 20:05:24 +02:00
AnotherTest
b91be8b9fd Shell: Make 'editor' a member of Shell, and provide a LibShell 2020-09-30 20:05:24 +02:00
Andreas Kling
e4bda2e1e7 LibJS: Move Console from Interpreter to GlobalObject
Each JS global object has its own "console", so it makes more sense to
store it in GlobalObject.

We'll need some smartness later to bundle up console messages from all
the different frames that make up a page later, but this works for now.
2020-09-29 21:15:06 +02:00
Luke
a9335eea1c LibWeb: Add cm, in, mm and Q CSS units 2020-09-29 20:46:18 +02:00
Andreas Kling
279a49cdf4 Base: Show how long it took to load the welcome.html page :^) 2020-09-29 18:36:00 +02:00
Andreas Kling
18cff5e0be LibWeb: Implement performance.timeOrigin
This is the origin timestamp of the same monotonic clock used for the
performance.now() timestamp.

I got a little confused while implementing this, since the numbers are
very low. That's because it uses the CLOCK_MONOTONIC system clock,
which we start counting from 0 at boot. :^)
2020-09-29 18:31:07 +02:00
Andreas Kling
62785b7872 LibCore: Expose origin timestamp of Core::ElapsedTime 2020-09-29 18:22:53 +02:00
Andreas Kling
97d0acc5b6 LibWeb: Implement performance.now()
This patch introduces the HighResolutionTime namespace which is home to
the Performance object (exposed via window.performance)

performance.now() is currently the only function, and it returns the
number of milliseconds since the window object was constructed. :^)
2020-09-29 18:19:18 +02:00
Andreas Kling
8cb789d061 LibWeb: Remove a bunch of unnecessary <LibJS/Interpreter.h> includes 2020-09-29 17:04:16 +02:00
Andreas Kling
be055b3ddd LibJS: Reduce use of Interpreter in Reference 2020-09-29 16:45:39 +02:00
Andreas Kling
3df604ad12 LibJS: Reduce use of Interpreter in LexicalEnvironment 2020-09-29 16:41:28 +02:00
asynts
1175ecf1dd AK+Format: Add support for integer to character casts.
Now the following is possible:

    outf("{:c}", 75); // K
2020-09-29 16:14:58 +02:00
asynts
f221a95a71 AK: Add NumericLimits specialization for char.
This is yet another bug because of the 'char'/'signed char'/'unsigned char' shit.
2020-09-29 16:14:58 +02:00
asynts
71b7ef0992 AK+Format: Support all format specifiers for strings.
The following is now possible:

    outf("{:.4}", "abcdef"); // abcd
    outf("{:*<8}", "abcdef"); // abcdef**
2020-09-29 16:14:58 +02:00
Luke
c0d9daadb0 LibGfx: Fix cut off CSS color names 2020-09-29 09:20:33 +02:00
Andreas Kling
709581e141 UserspaceEmulator: Implement the getsid() syscall 2020-09-28 23:34:55 +02:00
Andreas Kling
b058852c62 Kernel: Fix overly eager fd closing in sys$execve()
When obeying FD_CLOEXEC, we don't need to explicitly call close() on
all the FileDescriptions. We can just clear them out from the process
fd table. ~FileDescription() will call close() anyway.

This fixes an issue where TelnetServer would shut down accepted sockets
when exec'ing a shell for them. Since the parent process still has the
socket open, we should not force-close it. Just let go.
2020-09-28 22:40:44 +02:00
Andreas Kling
0930e2323b Kernel: Remove unnecessary capture in sys$execve() 2020-09-28 22:24:27 +02:00
Andreas Kling
f88a7cd4e1 LibCore: Make TCPServer::listen() report failure instead of asserting 2020-09-28 22:14:23 +02:00
Luke
d79194d87f Kernel: Return early in create_inode if name is too long 2020-09-28 21:52:31 +02:00
AnotherTest
cfa5e6efe9 Spreadsheet: Add the 'lookup' and 'reflookup' functions 2020-09-28 17:41:48 +02:00
AnotherTest
9c1143fe13 Spreadsheet: Add a 'choose' function 2020-09-28 17:41:48 +02:00
AnotherTest
f159d161fa Spreadsheet: Let the cells know their own position in the sheet 2020-09-28 17:41:48 +02:00
asynts
13ce24de13 AK+Format: Support default index in replacement field.
The following does now work:

    outf("{:0{}}", 1, 3);      // 001
2020-09-28 17:41:27 +02:00
asynts
afa2523724 Shell: Don't execute scripts interactively.
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.
2020-09-28 17:39:50 +02:00
Andreas Kling
d3d7ea7e75 LibWeb: LoadRequest::operator==() should compare header values
It was only comparing header names. Thanks to @Sponji for noticing!
2020-09-28 17:36:55 +02:00
asynts
574f49e4be AK+TestSuite: Don't assume that the test passed in output.
The problem with our test suite is that it can't detect if a test
failed. When a test fails we simply write 'FAIL ...' to stderr and move
on.

Previously, the test suite would list all tests as passing regardless
how many assertions failed. In the future it might be smart to implement
this properly but test suites for C++ are always hard to do nicely.
(Because C++ execution isn't meant to be embedded.)
2020-09-28 15:10:52 +02:00
Andreas Kling
9225bfa95e LibGUI: Correct inline editor placement in ColumnsView
Thanks to @bugaevc for noticing that I didn't account for the 1px space
between columns, and for the space occupied by the item icon.
2020-09-28 12:27:56 +02:00
Andreas Kling
ceda137bf2 LibWeb: Support <form method=POST>
Use the new support for HTTP method and request body to implement basic
support for POST'ed forms. This is pretty cool! :^)
2020-09-28 11:56:26 +02:00