2837 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
ea16fcf255 Merge pull request #512 from mitchellh/mouse-report
core: send proper reporting code for alt not super
2023-09-21 08:59:14 -07:00
Mitchell Hashimoto
b7055e2026 core: send proper reporting code for alt not super 2023-09-21 08:49:14 -07:00
Mitchell Hashimoto
44c90d02c4 Merge pull request #509 from mitchellh/csi-e-f
terminal: CSI E and F
2023-09-21 08:38:54 -07:00
Mitchell Hashimoto
92e98d34b5 terminal: CSI E and F 2023-09-21 08:21:32 -07:00
Mitchell Hashimoto
9af51a71e4 Merge pull request #506 from rockorager/xtversion
terminal: use larger buffer for xtversion response
2023-09-21 06:53:20 -07:00
Tim Culverhouse
5e800df277 osc: allow 0x20-0xFF in osc_put
The osc_string state of the parser limited accepted bytes to 0x7F. When
parsing a utf-8 encoded string as part of an OSC string, the parser
would encounter an error and abort the OSC parsing, allowing any
remaining bytes to be leaked (possibly) as printable characters to the
terminal window.

Allow any byte in the range 0x20 - 0xFF to be accepted by osc_put. Add
test cases which conflict with the 'anywhere' transitions (IE the utf8
sequence includes C1 control codes which might transition to another
state).
2023-09-21 03:08:41 -05:00
Tim Culverhouse
2d769b03ae terminal: use larger buffer for xtversion response
Commit fbe030d85a80 ("terminal: respond to XTVERSION query") introduced
responding to XTVERSION queries. The implementation uses the
.write_small method, which has a limit of 38 bytes. This works well if
your branch is named "main", since the branch is part of the
version_string variable. If you start using longer branch names, you can
quickly run into the limit.

The XTVERSION response is:

  "\x1bP>|ghostty d.d.d-<branch>+<12-digit-hash>\x07"

Which has an overhead of 32 bytes, meaning the natural branch limit is 6
bytes (6 characters, assuming you use ASCII branch names). Github has a
limit of 256 chars, so let's set a max XTVERSION buffer of 256+32 = 288

Fixes: fbe030d85a80 ("terminal: respond to XTVERSION query")
2023-09-21 03:04:23 -05:00
Mitchell Hashimoto
bf6ff079d4 Merge pull request #504 from mitchellh/macos-appearance
macos: window-theme setting to force light or dark theme
2023-09-20 22:14:26 -07:00
Mitchell Hashimoto
960edee559 macos: background-opacity getter 2023-09-20 22:05:23 -07:00