Ben Wiederhake
08f9bc26a6
Meta+LibHTTP through LibWeb: Make clang-format-10 clean
2020-09-25 21:18:17 +02:00
Nico Weber
61060c0da8
LibVT: Let Terminal keep history in a circular buffer
...
This makes Terminal::scroll_up() O(1) instead of O(n) in the
size of the history. (It's still O(n) in the size of visible
lines.)
Reduces time to run `disasm /bin/id` with the default terminal
window size from 530ms to 409ms (min-of-5) on my system.
2020-09-10 12:01:26 +02:00
Nico Weber
90d9c83067
LibVT: Let Terminal only expose history_size, not storage
2020-09-10 12:01:26 +02:00
Nico Weber
ce95628b7f
Unicode: Try s/codepoint/code_point/g again
...
This time, without trailing 's'. Ran:
git grep -l 'codepoint' | xargs sed -ie 's/codepoint/code_point/g
2020-08-05 22:33:42 +02:00
Nico Weber
19ac1f6368
Revert "Unicode: s/codepoint/code_point/g"
...
This reverts commit ea9ac3155d
.
It replaced "codepoint" with "code_points", not "code_point".
2020-08-05 22:33:42 +02:00
Andreas Kling
ea9ac3155d
Unicode: s/codepoint/code_point/g
...
Unicode calls them "code points" so let's follow their style.
2020-08-03 19:06:41 +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
11c4a28660
Kernel: Move headers intended for userspace use into Kernel/API/
2020-07-04 17:22:23 +02:00
Hüseyin ASLITÜRK
7abca30f41
LibVT: Replace u8 type to u32 for code point
...
Replace KeyEvent text attribute usage with code_point.
2020-06-16 13:15:17 +02:00
Andreas Kling
165f69023b
LibVT: Allow updating the window progress via an escape sequence
...
You can now request an update of the terminal's window progress by
sending this escape sequence:
<esc>]9;<value>;<max_value>;<escape><backslash>
I'm sure we can find many interesting uses for this! :^)
2020-05-30 23:00:35 +02:00
Sergey Bugaev
620697d924
LibVT: Move most of key press handling logic into VT::Terminal
...
This will let us share it between the userspace (TerminalWidget) and the Kernel.
2020-05-27 11:19:38 +02:00
Andreas Kling
b8498dc55e
LibVT: Add incremental UTF-8 parsing to the terminal input handler
...
Instead of relying on the GUI code to handle UTF-8, we now process
and parse the incoming data into 32-bit codepoints ourselves.
This means that you can now show emojis in the terminal and they will
only take up one character cell each. :^)
2020-05-16 19:49:24 +02:00
Andreas Kling
06f3eb0ecd
LibVT: Tweak input parsing related names
2020-05-16 19:30:46 +02:00
Andreas Kling
c4edc4c550
LibVT: Switch VT::Line to being backed by 32-bit codepoints
...
This will allow us to have much better Unicode support. It does incur
a memory usage regression which we'll have to optimize to cover.
2020-05-16 19:30:43 +02:00
Andreas Kling
16965db86b
LibVT: Move out the Line class from Terminal to its own class
2020-05-15 18:57:50 +02:00
AnotherTest
5b9fe0cf46
LibVT: Update the terminal buffer based on visible lines
...
Lines in the history should not be considered for update at all.
Fixes #2185
2020-05-11 09:33:18 +02:00
Andreas Kling
901d2e3236
LibVT: Make selection follow terminal history scrollback :^)
...
The buffer positions referred to by a VT::Position now include history
scrollback, meaning that a VT::Position with row=0 is at the start of
the history.
The active terminal buffer keeps moving in VT::Position coordinates
whenever we scroll. This allows selection to follow history. It also
allows us to click hyperlinks in history.
Fixes #957 .
2020-05-10 16:59:02 +02:00
AnotherTest
8487806ec0
LibVT: Support RGB colors (\x1b[38;2;<r>;<g>;<b>m)
2020-05-10 10:23:05 +02:00
Andreas Kling
f596b12a04
LibVT+Terminal: Support hyperlinks in the terminal :^)
...
We now support basic hyperlinking in the terminal with <OSC>;8;;URL<ST>
Links are opened via LaunchServer on Ctrl+LeftMouse.
2020-05-09 16:16:16 +02:00
Andreas Kling
b65ca3b944
LibVT: Make Terminal::Line non-copyable and non-movable
2020-05-09 13:20:01 +02:00
Andreas Kling
a0616d96bf
LibVT: Make the Xterm/OSC sequence parsing a bit more robust
...
Tolerate sequences ending in both <0x07> (BEL) and <0x1b> <0x5c> (ST).
The former is apparently an Xterm extension and the latter is standard.
2020-05-09 12:08:41 +02:00
Andreas Kling
283bd1a95c
LibVT: Respond to DSR 0 (device status)
...
Also emit query responses in a single write() syscall instead of going
character-at-a-time.
2020-05-09 12:02:22 +02:00
AnotherTest
2663739db1
LibVT: Implement Device Status Report (cursor position report)
2020-04-10 00:58:59 +02:00
Andreas Kling
ceec1a7d38
AK: Make Vector use size_t for its size and capacity
2020-02-25 14:52:35 +01:00
Linus Groh
174583cda5
LibVT: Add parameter names in function signatures for clarity
2020-01-26 15:58:06 +01:00
Linus Groh
3549623dc6
LibVT: Rename escape$r to DECSTBM (Set Top and Bottom Margins)
2020-01-26 15:58:06 +01:00
Linus Groh
fd8c250866
LibVT: Replace escape$h_l with SM (Set Mode) / RM (Reset Mode)
2020-01-26 15:58:06 +01:00
Linus Groh
be57b81336
LibVT: Rename escape$f to HVP (Horizontal and Vertical Position)
2020-01-26 15:58:06 +01:00
Linus Groh
2edd8e37ae
LibVT: Rename escape$c to DA (Device Attributes)
2020-01-26 15:58:06 +01:00
Linus Groh
dcb5bf9e50
LibVT: Rename escape$m to SGR (Select Graphic Rendition)
2020-01-26 15:58:06 +01:00
Linus Groh
296afbe624
LibVT: Rename escape$H to CUP (Cursor Position)
2020-01-26 15:58:06 +01:00
Linus Groh
5cdfc58242
LibVT: Rename escape$D to CUB (Cursor Backward)
2020-01-26 15:58:06 +01:00
Linus Groh
428a55a196
LibVT: Rename escape$C to CUF (Cursor Forward)
2020-01-26 15:58:06 +01:00
Linus Groh
35310dbd22
LibVT: Rename escape$B to CUD (Cursor Down)
2020-01-26 15:58:06 +01:00
Linus Groh
cc73284c64
LibVT: Rename escape$A to CUU (Cursor Up)
2020-01-26 15:58:06 +01:00
Andreas Kling
8c1f2d7131
LibVT: Rename escape$K and escape$J to EL and ED respectively
...
We should rename all of these functions to match the real VT100 names.
This will make it 100% easier to work on LibVT.
For reference: https://vt100.net/docs/vt100-ug/
2020-01-25 20:54:40 +01:00
Andreas Kling
dca92af431
LibVT: Support IND and RI (cursor down/up basically)
2020-01-25 20:26:35 +01:00
Andreas Kling
0d191aae13
LibVT: Rename EscapeState::ExpectBracket => GotEscape
...
Seems like there are many escape sequences that don't start with
brackets, so let's call the post-escape state "GotEscape" instead. :^)
2020-01-25 20:02:31 +01:00
Andreas Kling
897ad1b927
LibVT: Support NEL (Next Line)
...
I think this can just behave as if you sent a newline character ('\n').
2020-01-25 20:01:43 +01:00
Andreas Kling
ab77bd4c3a
LibVT: Support <esc>#8 to fill screen with E's
...
This is apparently a "confidence test" supported by VT100.
2020-01-25 19:52:35 +01:00
Andreas Kling
20e41ab381
LibVT: Support HVP (Horizontal and Vertical Position) (final 'f')
2020-01-25 19:49:42 +01:00
Andreas Kling
e6f5ce8285
LibVT: Support the DA (Device Attributes) request (final 'c')
...
This is used by vttest on startup to query the device for identity.
2020-01-25 19:12:08 +01:00
Andreas Kling
94ca55cefd
Meta: Add license header to source files
...
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.
For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.
Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
joshua stein
5c25983844
LibVT: enforce a minimum size of 1 column and 1 row
...
Fixes #829
2020-01-16 12:41:09 +01:00
Andreas Kling
5a83e053b3
LibVT: Make inject_string() a public API so clients can use it
...
This API allows you to add arbitrary input at the current cursor
position. You can even do escape sequences! :^)
2019-10-22 22:14:36 +02:00
Andreas Kling
73fdbba59c
AK: Rename <AK/AKString.h> to <AK/String.h>
...
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.
Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Sergey Bugaev
6d3f52c4a4
Terminal: Add some basic emoji support
...
This is not as perfect as it is elsewhere in the system, as we cannot
really change how terminal "thinks about" characters and bytes. What
we can do though, and what this commit does, is to *render* emojis, but
make it seem as if they take up all the space, and all the columns their
bytes would take if they were all regular characters.
2019-09-05 16:37:39 +02:00
Andreas Kling
462336ed49
LibVT: Add scrollback history to VT::Terminal
...
The default (hard-coded) history size is 500 lines. When the history is
altered, the TerminalClient is notified via terminal_history_changed().
2019-08-19 19:07:52 +02:00
Andreas Kling
ca9592d56f
LibVT: Shave down VT::Attribute from 8 bytes to 3 bytes
...
We have one of these per character in the terminal buffers, so it's a
decent haircut. :^)
2019-08-13 12:59:58 +02:00
Andreas Kling
4fb02c78a9
LibVT: Rename VT::BufferPosition to VT::Position and move to own file
2019-08-13 12:56:10 +02:00