2806 Commits

Author SHA1 Message Date
Tim Culverhouse
3264e70701 terminal: don't modify pen state when erasing eraseDisplay
Erasing the display should be done with only the background attribute of
the current pen. This is the current behavior but is done by altering
the current pen state. The pen state should remain after erasure. Use a
new pen variable to erase the display to enable retaining the pen state.
Add a test condition.
2023-09-25 12:25:45 -05:00
Tim Culverhouse
b592b069c8 terminal: retain cursor and charset when entering alt screen
The state of the cursor and charset should be retained when entering the
alternate screen.

Fixes: alacritty/save_cursor_alt
2023-09-25 11:42:01 -05:00
Tim Culverhouse
66875206bb terminal: move charset to screen
Each screen (primary and alternate) retains the state of the current
charset when DECSC (save cursor) is called. Move the CharsetState into
the screen to enable saving the state with each screen.

Add a test for charset state on screen change
2023-09-25 10:43:39 -05:00
Mitchell Hashimoto
601ca5e7de Merge pull request #531 from mitchellh/codepoint-map
Specify font for specific codepoint ranges
2023-09-24 21:06:51 -07:00
Mitchell Hashimoto
7a9a36ecb0 config: remove unused test, make parse test more intense 2023-09-24 20:49:53 -07:00
Mitchell Hashimoto
6ac4cc9671 font: debug log for overide 2023-09-24 20:40:36 -07:00
Mitchell Hashimoto
41170bb4e0 config: codepoint override font descriptors should not require monospace 2023-09-24 20:36:07 -07:00
Mitchell Hashimoto
c2cc2b8f03 core: hook up the codepoint map to the loaded font group 2023-09-24 20:35:05 -07:00
Mitchell Hashimoto
a8877d334c config: unicode range parser is more lenient about whitespace 2023-09-24 20:32:35 -07:00
Mitchell Hashimoto
bcafbc8abb config: add font-codepoint-map 2023-09-24 20:28:24 -07:00
Mitchell Hashimoto
f25a3ce87d Merge pull request #530 from rockorager/dev
terminal: fix alacritty tests insert_blank_reset and saved_cursor
2023-09-24 20:04:21 -07:00
Tim Culverhouse
3d35ae1869 terminal: save charset state and DECOM mode when saving cursor
The charset state and DECOM mode should be saved along with the cursor
state.

Reference: https://vt100.net/docs/vt510-rm/DECSC.html
Fixes: alacritty/saved_cursor
2023-09-24 21:56:48 -05:00
Tim Culverhouse
17ee5c7fd5 terminal: insert a blank cell in insertBlanks
The name sounds obvious, but nothing ever is with ANSI escapes. ICH
(Insert Blank Characters) should insert a cell with no attributes or
colors set.

Remove comment about inserting a space for tests: the tests pass with a
blank cell inserted.

Remove comment about inserted cells having current SGR.

Update tests to check for attribute of inserted cell.
2023-09-24 21:56:48 -05:00
Mitchell Hashimoto
abd3e16ebd font: Group will use the codepoint map for codepoint overrides 2023-09-24 19:44:06 -07:00
Mitchell Hashimoto
d9644e4357 Merge pull request #529 from rockorager/alacritty/deccolm_reset
terminal: make deleteChars insert blank cells
2023-09-24 19:27:33 -07:00
Tim Culverhouse
5f87e09d61 terminal: make deleteChars insert blank cells
When DCH (deleteChars) deletes cells from a line, cells are inserted
from the right. The new cells should not have the current pen style, and
should instead be an empty cell.

Add check for this in the existing test.

Fixes: alacritty/deccolm_reset
2023-09-24 19:12:38 -05:00
Mitchell Hashimoto
5c1c090f39 font: change FontIndex to a u16 since we can expect more fonts with maps 2023-09-24 15:53:39 -07:00
Mitchell Hashimoto
9e2e3acecf font: add codepoint map and descriptor cache to Group, not used yet 2023-09-24 11:50:03 -07:00
Mitchell Hashimoto
3915d9ee3a font: add CodepointMap with tests 2023-09-24 11:22:57 -07:00
Mitchell Hashimoto
6b640c2d9f font: discovery descriptor can be hashed 2023-09-24 11:17:07 -07:00
Mitchell Hashimoto
4e54c5389e font: CodepointMap 2023-09-24 11:10:20 -07:00
Mitchell Hashimoto
49dbd8d151 font/shaper: fix failing test on macos 2023-09-24 11:10:04 -07:00
Mitchell Hashimoto
7a8aea6c77 config: update some docs to clarify how to disable ligatures 2023-09-24 09:38:37 -07:00
Mitchell Hashimoto
768d999342 Merge pull request #528 from mitchellh/font-style
Font style
2023-09-24 09:15:50 -07:00
Mitchell Hashimoto
efa6d85855 config: update docs 2023-09-24 09:15:32 -07:00
Mitchell Hashimoto
52591161bc config: add font-style configurations 2023-09-24 09:13:25 -07:00
Mitchell Hashimoto
16cecc082a font: fallback should not restrict to only monospace 2023-09-24 09:05:40 -07:00
Mitchell Hashimoto
8e083d8618 font/fontconfig: support style descriptor 2023-09-24 09:05:07 -07:00
Mitchell Hashimoto
966166015f font/core-text: discovery supports style search 2023-09-24 09:02:35 -07:00
Mitchell Hashimoto
4b58b01555 Merge pull request #527 from mitchellh/cmd-list-fonts
"ghostty +list-fonts" to inspect font discovery
2023-09-24 08:57:03 -07:00
Mitchell Hashimoto
54976e8829 cli/list-fonts: flags, help 2023-09-24 08:48:45 -07:00
Mitchell Hashimoto
70a2a0556d font: fontconfig should not omit earlier fonts 2023-09-24 08:42:12 -07:00
Mitchell Hashimoto
4eb31322c9 cli/list-fonts: don't use arrayhashmap 2023-09-24 08:28:28 -07:00
Mitchell Hashimoto
11440a3a4c cli/list-fonts 2023-09-24 08:23:12 -07:00
Mitchell Hashimoto
2fb14eee09 font: CoreText discovery searches monospace only by default 2023-09-24 08:22:50 -07:00
Mitchell Hashimoto
8214471e2c cli/list-fonts: dumb implementation 2023-09-23 22:59:22 -07:00
Mitchell Hashimoto
9421bec3a1 cli: move cli_args.zig to cli 2023-09-23 22:46:16 -07:00
Mitchell Hashimoto
7fc66f3851 cli: dedicated directory 2023-09-23 22:42:09 -07:00
Mitchell Hashimoto
056de47b76 terminal: make switch true/false more idiomatic zig 2023-09-22 23:12:46 -07:00
Mitchell Hashimoto
e73d8ff378 Merge pull request #525 from rockorager/alacritty/colored_reset
terminal: ensure 'has_bg' is set in eraseDisplay
2023-09-22 23:09:38 -07:00
Tim Culverhouse
2051e6bb3a terminal: ensure 'has_bg' is set in eraseDisplay
Add a check for 'has_bg', and if it is set retain the background color.
If it isn't set, we are safe to set the pen to it's default.

Fixes: alacritty/colored_reset
2023-09-23 00:37:59 -05:00
Mitchell Hashimoto
b627cca34b Merge pull request #523 from rockorager/alacritty/clear_underline
terminal: erase pen, except bg, in eraseDisplay
2023-09-22 19:16:30 -07:00
Tim Culverhouse
c5df73b1da terminal: erase pen, except bg, in eraseDisplay
When erasing the display, all attributes of the pen must be cleared
_except_ for the background. Add unit tests for erasing the display in
all scenarios.

Fixes: alacritty/clear_underline
2023-09-22 21:14:36 -05:00
Mitchell Hashimoto
b4c4c37bab Merge pull request #522 from rockorager/alacritty/alt_reset
terminal: reset cursor state before eraseDisplay in fullReset
2023-09-22 18:37:52 -07:00
Tim Culverhouse
2784f25b5b terminal: reset cursor state before eraseDisplay in fullReset
fullReset resets the state of the terminal. This method calls
eraseDisplay, which depends on the state of the cursor pen for setting
the cell styles when it erases. Reset the state of the cursor prior to
calling eraseDisplay to ensure a clean reset.

Fixes: alacritty/alt_reset test
2023-09-22 20:11:04 -05:00
Mitchell Hashimoto
300ba32ad0 macos: enum does not need to be a string 2023-09-22 15:48:41 -07:00
Mitchell Hashimoto
1eb0dbb548 macos: more robust cursor visibility handling
Fixes #519

The core issue here was that `mouseEntered` was called AFTER
`cursorUpdate` (by Cocoa) so we were messing up our NSCursor state. To
fix this more robustly, all cursor state should ONLY be handled by
cursorUpdate and mouseEntered/Exit goes through that system now.
2023-09-22 15:47:08 -07:00
Mitchell Hashimoto
510f0fe8f2 apprt/embedded: if a physical key input is a keypad key, keep it 2023-09-22 11:44:18 -07:00
Mitchell Hashimoto
4b8056afd8 renderer/opengl: remove gpucell lru cache
There was no noticable performance improvement and it complicated the
code and also diverged it from Metal.
2023-09-22 09:47:01 -07:00
Mitchell Hashimoto
bebf6bb108 renderer/opengl: only skip drawing cells if they're empty, not clear
Fixes #518

This optimization to avoid a draw call to OpenGL was premature. This
optimization is fine but needs to happen only for the draw calls. We
still need to clear the screen if we have no cells.

This was causing #518 because when the cursor was blinked (invisible)
then we had no cells so we'd skip the draw call which reused the old
buffer state for OpenGL.
2023-09-22 09:45:26 -07:00