Andreas Kling
dddd0e7b03
Get nyancat nyanning in Serenity.
...
I found a cute program that renders an animated nyancat in the terminal.
This patch adds enough hackery to get it working correctly. :^)
2019-02-03 16:11:28 +01:00
Andreas Kling
3944c00f23
Terminal: Add limited support for 'M' escape sequence (delete line.)
2019-02-03 14:00:48 +01:00
Andreas Kling
db2422d0d3
Terminal: Constrain the cursor inside the terminal rect.
2019-02-03 04:04:42 +01:00
Andreas Kling
5e0b7f1a56
Add basic automatic dependency management to Makefiles.
2019-02-02 04:41:59 +01:00
Andreas Kling
240b5fe677
Terminal: Draw the cursor by reversing foreground/background color.
...
This makes the cursor pleasantly see-through.
2019-02-01 05:40:27 +01:00
Andreas Kling
ffab6897aa
Big, possibly complete sweep of naming changes.
2019-01-31 17:31:23 +01:00
Andreas Kling
2c6a3f1907
Terminal: Oops, escape sequences for the left and right keys were swapped.
2019-01-30 21:20:44 +01:00
Andreas Kling
56b6fb198a
Add support for keyboard arrow keys.
...
Also have them send the appropriate escape sequences in Terminal.
Basic history browsing now works in bash. How nice! :^)
2019-01-30 21:18:13 +01:00
Andreas Kling
f176af7cd1
Terminal: Implement 'J' escape "clear from cursor to end of screen."
2019-01-30 21:04:49 +01:00
Andreas Kling
2b4374d08e
Let the slave PTY keep the master PTY alive.
...
This ownership model is a bit confusing. There's a retain cycle between
MasterPTY and SlavePTY, but it's broken when the SlavePTY is closed, meaning
that there are no more FileDescriptors referring to it.
2019-01-30 19:05:59 +01:00
Andreas Kling
b4e478aa50
Deallocate PTY's when they close.
...
This required a fair bit of plumbing. The CharacterDevice::close() virtual
will now be closed by ~FileDescriptor(), allowing device implementations to
do custom cleanup at that point.
One big problem remains: if the master PTY is closed before the slave PTY,
we go into crashy land.
2019-01-30 18:47:18 +01:00
Andreas Kling
ad53f6afd3
LibC: Move Stopwatch thingy into a <serenity.h> header.
...
This thing is extremely useful for performance testing so let's put it here.
2019-01-28 23:01:47 +01:00
Andreas Kling
7cf3c7461c
Refactor GUI rendering model to be two-phased.
...
Instead of clients painting whenever they feel like it, we now ask that they
paint in response to a paint message.
After finishing painting, clients notify the WindowServer about the rect(s)
they painted into and then flush eventually happens, etc.
This stuff leaves us with a lot of badly named things. Need to fix that.
2019-01-26 05:20:32 +01:00
Andreas Kling
5adaeeaa3b
Terminal: Support setting the window title using Xterm escape sequences.
...
Use this in the /bin/sh prompt to keep the window title in sync with the
shell's working directory. :^)
2019-01-25 05:52:16 +01:00
Andreas Kling
623847cf6d
Terminal: Tweak dark blue color.
2019-01-25 03:24:52 +01:00
Andreas Kling
267a903dd0
Terminal: Redraw entire line if any of its characters are dirty.
...
This means we only have to do one fill_rect() per line and the whole process
ends up being ~10% faster than before.
Also added a read_tsc() syscall to give userspace access to the TSC.
2019-01-25 02:09:29 +01:00
Andreas Kling
11b73c38d8
Kernel: Fix incorrect EFAULTs when syscall would write into COW pages.
2019-01-25 01:39:15 +01:00
Andreas Kling
a4a106a430
Terminal: Use a more reasonable data structure for the emulation buffer.
2019-01-25 01:27:02 +01:00
Andreas Kling
86eae0f8df
Let userland retain the window backing store while drawing into it.
...
To start painting, call:
gui$get_window_backing_store()
Then finish up with:
gui$release_window_backing_store()
Process will retain the underlying GraphicsBitmap behind the scenes.
This fixes racing between the WindowServer and GUI clients.
This patch also adds a WSWindowLocker that is exactly what it sounds like.
2019-01-24 23:44:19 +01:00
Andreas Kling
ff4d6afb60
Terminal: Turn ctrl+character into the appropriate ^character.
2019-01-24 20:43:45 +01:00
Andreas Kling
faaa0dbf1d
Terminal: Various improvements to terminal emulation.
2019-01-23 19:59:17 +01:00
Andreas Kling
9ae20a153e
Terminal: Add support for some more escape sequences.
2019-01-23 08:55:59 +01:00
Andreas Kling
b33e367f33
Terminal: Fix crash when scrolling contents while cursor is on first row.
2019-01-23 07:45:23 +01:00
Andreas Kling
3271c115e2
WindowServer: Only blit dirty rect of windows to back buffer.
...
Previously we'd blit every pixel in every window that intersected any dirty
rect to the back buffer. With this patch, we limit ourselves to blitting the
pixels inside the actual dirty rects.
There's still a lot of optimizations to make in this code.
2019-01-20 23:42:36 +01:00
Andreas Kling
dbe83f3a83
Make it possible for userspace to alter window title/geometry.
...
I'm not in love with this syscall API but it allows me to make progress.
2019-01-20 06:04:13 +01:00
Andreas Kling
7e5b81fe48
Make a SharedGraphics directory for classes shared between Kernel and LibGUI.
2019-01-19 23:22:46 +01:00
Andreas Kling
dff70021ab
Make it possible to invalidate only a portion of a window.
...
Use this in Terminal to only invalidate rows where anything changed.
2019-01-18 04:37:49 +01:00
Andreas Kling
dad58db757
Add WindowActivated and WindowDeactivated events.
...
Use this to implement different looking Terminal cursors depending on
the window active state.
2019-01-17 17:38:04 +01:00
Andreas Kling
135ff48bb9
Terminal: Tighten the glyph rects.
...
This makes the cursor look a bit nicer.
2019-01-17 16:34:37 +01:00
Andreas Kling
5983a217c3
Terminal: Draw the terminal cursor.
2019-01-17 16:19:49 +01:00
Andreas Kling
7750e6952b
Move some more classes to the new coding style.
2019-01-16 17:57:58 +01:00
Andreas Kling
9dd29f9aa9
Add a PTY multiplexer (/dev/ptmx) device.
...
When you open /dev/ptmx, you get a file descriptor pointing to one of the
available MasterPTY's. If none are available, you get an EBUSY.
This makes it possible to open multiple (up to 4) Terminals. :^)
To support this, I also added a CharacterDevice::open() that gets control
when VFS is opening a CharacterDevice. This is useful when we want to return
a custom FileDescriptor like we do here.
2019-01-16 13:39:32 +01:00
Andreas Kling
b46ae2bf09
Get rid of Vnode concept.
...
We already have an abstraction between Process and Inode/CharacterDevice/FIFO
and it's called FileDescriptor. :^)
2019-01-16 12:57:07 +01:00
Andreas Kling
10387beda7
Implement basic support for POSIX-style select().
...
Now we can block on both the PTY *and* the GUI event stream in Terminal.
2019-01-16 00:09:58 +01:00
Andreas Kling
d0137f0e96
Terminal: optimize repaints a bunch.
...
We track dirty character cells + pending whole-terminal scrolls.
This drastically reduces the number of pixels pushed.
2019-01-15 10:23:15 +01:00
Andreas Kling
49b63281a0
Make it possible for a process to switch controlling terminals.
...
Via the TIOCSCTTY and TIOCNOTTY ioctls.
2019-01-15 08:49:24 +01:00
Andreas Kling
a8e42bacf4
Minor Terminal tweaks.
2019-01-15 07:57:30 +01:00
Andreas Kling
d14ec951ea
Terminal: Add some inset and line spacing.
...
This is starting to feel vaguely usable! :^)
2019-01-15 07:39:51 +01:00
Andreas Kling
c24f543a57
Terminal: basic ANSI color support.
2019-01-15 07:30:24 +01:00
Andreas Kling
78696236d3
Add very basic KeyDown events to the GUI event stream.
...
The Terminal program now hosts an interactive shell. :^)
2019-01-15 06:51:00 +01:00
Andreas Kling
2f74c2f430
Add basic PTY support.
...
For now, there are four hard-coded PTYs: /dev/pt{m,s}[0123]
Use this in the Terminal to open a pty pair and spawn a shell.
2019-01-15 06:30:19 +01:00
Andreas Kling
ecb4ab0943
Add Terminal/.gitignore
2019-01-15 04:49:01 +01:00
Andreas Kling
dfff2996d2
Factor out individual glyph drawing into Painter::draw_glyph().
2019-01-15 04:44:47 +01:00
Andreas Kling
6d8043767e
Start working on a graphical Terminal program.
2019-01-15 04:30:55 +01:00