2896 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
d287e741b1 apprt/embedded: initialize unmodified keystate prior to use
Fixes #521

We were not initializing the dead key state. The dead key state is read
on all translation calls so it must be initialized to 0. This was
working before because coincidentally whatever the memory was always
worked (it probably didn't, but it never didn't work for someone to
notice).

In debug modes, Zig sets uninitialized memory to 0xAAAAAAAA. Amusingly,
this is a valid dead key state value that UCKeyTranslate ignores and
thus produces the correct value. Therefore, we were only seeing bugs in
release modes where the uninitialized memory was a bad value
(consistently 0x1 on my machine) causing the wrong key to come out.

We were getting lucky before, this has always been a bug.
2023-09-22 09:18:52 -07:00
Mitchell Hashimoto
4a774b088b Merge pull request #516 from rockorager/Smulx
terminfo: add Smulx (underline styles) entry
2023-09-21 14:50:28 -07:00
Tim Culverhouse
e70e763e8c terminfo: add Smulx (underline styles) entry
Add a terminfo entry for Smulx, which advertises support for curly,
dashed, dotted, etc underlines

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2023-09-21 16:47:10 -05:00
Mitchell Hashimoto
26c9f1325e Merge pull request #515 from mitchellh/update-zig
update zig to 0.12.0-dev.464+a63a1c5cb
2023-09-21 11:26:48 -07:00
Mitchell Hashimoto
e644be3b25 update zig to 0.12.0-dev.464+a63a1c5cb 2023-09-21 11:03:34 -07:00
Mitchell Hashimoto
ec7ab5b6a4 apprt/gtk: always set app ID, use G_APPLICATION_NON_UNIQUE instead
This makes the icon and title work on Wayland while retaining the
gtk-single-instance functionality.
2023-09-21 10:57:10 -07:00
Mitchell Hashimoto
2889271ee0 Merge pull request #507 from rockorager/osc_utf8
osc: allow 0x20-0xFF in osc_put
2023-09-21 09:58:51 -07:00
Mitchell Hashimoto
680478ed88 Merge pull request #513 from mitchellh/macos-mouse
macos: multiple mouse-hide-while-typing fixes
2023-09-21 09:50:15 -07:00
Mitchell Hashimoto
7f549c5b41 macos: detect mouseEntered/Exit on frame change 2023-09-21 09:42:17 -07:00
Mitchell Hashimoto
d12f07ceda macos: mouse tracking area should always send
Without this, non-first-responder views would not receive mouse
entered/exit events. This would break some of our mouse hiding state.
See comments for more info.
2023-09-21 09:30:42 -07:00