3716 Commits

Author SHA1 Message Date
Mitchell Hashimoto
bc80073ffd core: add emoji fallback on macOS after built-in font
This doesn't fix any issues, but it slightly improves performance since
we'll try our text font first which is most likely to hit most input.
2024-01-08 08:01:17 -08:00
Mitchell Hashimoto
ab606c6cfd font: autoitalic should only apply to text presentation
Fixes #1256
2024-01-08 07:57:42 -08:00
Tim Culverhouse
e90a6ee19f input: never report associated text on key release
Associated text should only be reported when it was generated from the
key event. To my knowledge, there are no release events which produce
text. This now matches kitty reporting for release events.
2024-01-08 07:32:18 -06:00
Mitchell Hashimoto
2082751a65 font/shaper: prevent underflow in multi-cell lig detection
Fixes #1251

See the comment for details.
2024-01-07 22:16:11 -08:00
Jeffrey C. Ollie
342b5e9d06 implement enquiry 2024-01-07 23:50:58 -06:00
Mitchell Hashimoto
ba45e4120e Merge pull request #1248 from der-teufel-programming/main
WIP: Update Ghostty to use the new build system API
2024-01-07 15:34:38 -08:00
Mitchell Hashimoto
62e5234da4 renderer: for constrained cells, offset was being doubled
This helps better preserve the centerline for constrained glyphs
2024-01-07 15:02:56 -08:00
Mitchell Hashimoto
f7c558e733 renderer: constrain dingbats category to cell size
Dingbats are generally symbolic glyphs that frequently overflow the
cell. Their defined codepoint width is "1" so they take one cell but
very often overflow to the next.

This extends the previously created logic for Nerd Font symbols such
that when a dingbat is next to whitespace, we allow it to use the full
size, but when a dingbat is next to an occupied cell we constrain it to
the cell size.
2024-01-07 14:54:15 -08:00
Mitchell Hashimoto
162ebaa8fa Merge pull request #1246 from rbino/linux-xft-dpi
linux: consider Xft.dpi to scale the content
2024-01-07 12:29:13 -08:00
Mitchell Hashimoto
b62c78b61d apprt/gtk: stylistic changes 2024-01-07 12:25:56 -08:00
Mitchell Hashimoto
a8a42c8658 fix macos zig build test failures 2024-01-07 12:10:48 -08:00
Krzysztof Wolicki
f917be968d Merge branch 'mitchellh:main' into main 2024-01-07 19:13:06 +01:00
Riccardo Binetti
ad503b8c4f linux: consider Xft.dpi to scale the content
Many applications use Xft.dpi to scale their contents (e.g. Chromium,
kitty, alacritty...). This value also gets set by DE setting managers
and can be manually set in ~/.Xresources if using, e.g., i3.

This should make HiDPI on Linux more consistent even when not using
GTK-specific methods (e.g. GDK_SCALE=2).

Note that we still consider GTK scaling, so it's possible to use the two
independently.

Closes #1243
2024-01-07 17:16:16 +01:00
Mitchell Hashimoto
383b7c5870 core: clear_screen binding doesn't consume on alt screen
The clear_screen binding does nothing on the alternate screen already,
but we were still marking the action as "performed" which caused the
binding to be consumed.

This meant that alt screen applications like neovim, tmux, etc. couldn't
see "cmd+k" (default binding for clear_screen on macOS) without the
Ghostty user unbinding it completely.

We already have other bindings that do not consume only when they do not
perform, such as `previous_tab` and `next_tab`. This extends the
framework we built for that to this action.
2024-01-07 07:54:42 -08:00
Riccardo Binetti
fe0842c2d0 linux: add a function to check if we're running on X11 2024-01-07 16:54:01 +01:00
Mitchell Hashimoto
f447e6f9df font: insert blank cells for multi-cell ligatures for styling
Up to this point, every font I've experienced with ligatures has
replaced the codepoints that were replaced for combining with a space.
For example, if a font has a ligature for "!=" to turn it into a glyph,
it'd shape to `[not equal glyph, space]`, so it'd still take up two
cells, allowing us to style both.

Monaspace, however, does not do this. It turns "!=" into `[not equal
glyph]` so styles like backgrounds, underlines, etc. were not extending.

This commit detects multi-cell glyphs and inserts synthetic blank cells
so that styling returns. I decided to do this via synthetic blank cells
instead of introducing a `cell_width` to the shaper result because this
simplifies the renderers to assume each shaper cell is one cell. We can
change this later if we need to.

Annoyingly, this does make the shaper slightly slower for EVERYONE to
accomodate one known font that behaves this way. I haven't benchmarked
it but my belief is that the performance impact will be negligible
because to figure out cell width we're only accessing subsequent cells
so they're likely to be in the CPU cache and also 99% of cells are going
to be width 1.
2024-01-06 19:22:25 -08:00
Mitchell Hashimoto
d65fbba39e config: do not load command from SHELL when launched from desktop
Fixes #139

From the issue:

Looking into this now, I think I figured out the broken logic. When launching
from open, the parent process of Ghostty is launchd which appears to set your
SHELL env var to your configured shell when logging in. That's why a restart
fixes it. However, I believe directory services (the macOS equivalent to
/etc/passwd) is updated in real time.

Ghostty does read directory services but at a lower priority than SHELL.
This logic makes sense for CLI-launched terminals but not desktop-launched.
From a CLI you want the terminal you're launching to probably inherit the shell
from the CLI you launched it from. (Note that using open explicitly forces a
launchd-style launch so it quacks as if it was double-clicked on the desktop).

In conclusion, I believe the correct logic is to invert the priority on SHELL
vs directory services when Ghostty detects it was launched from launchd. We
already have this detection logic in Ghostty because we use it for a number of
other things as well, so this should be easy to fix. I'll work on it later
today.
2024-01-06 12:31:01 -08:00
Mitchell Hashimoto
8a816dc5ef os: mac app launched with bundle env var is treated as desktop launch 2024-01-06 12:30:44 -08:00
Mitchell Hashimoto
962be81f71 core: add Apple Color Emoji on macOS if its available 2024-01-05 21:03:37 -08:00
Krzysztof Wolicki
710b02a2ab Merge branch 'main' of github.com:mitchellh/ghostty 2024-01-06 05:42:55 +01:00
Mitchell Hashimoto
48f316ebd2 termio: support XDG data dirs greater than 4k for fish shell integration
Fixes #1228
2024-01-05 14:27:12 -08:00
Mitchell Hashimoto
095394e562 Merge pull request #1226 from mitchellh/boehs/1213
Fix #1213 (create dir if needed for settings)
2024-01-05 09:03:14 -08:00
Mitchell Hashimoto
cf18e23256 config: create the config dir recursively for edit 2024-01-05 09:01:30 -08:00
Mitchell Hashimoto
a62061aec6 config: use dirname so we don't have to alloc a new dir for edit 2024-01-05 07:54:20 -08:00
Gregory Anders
5fe2d03e96 cli: strip CR in line iterator 2024-01-05 09:37:55 -06:00
Evan Boehs
3a93831e39 Fix #1213 (create dir if needed for settings) 2024-01-05 10:36:26 -05:00
Mitchell Hashimoto
20300f46da Merge pull request #1220 from jcollie/gtk-open-config-menu
Add 'Open Config' menu to the GTK runtime and synchronize config-related keybindings across platforms.
2024-01-04 22:04:54 -08:00
Mitchell Hashimoto
be176bb8bd renderer: reload background, foreground, cursor-color at runtime
Fixes #1212
2024-01-04 21:47:12 -08:00
Jeffrey C. Ollie
698954031a Add 'Open Config' menu to the GTK runtime and synchronize config-related keybindings across platforms. 2024-01-04 23:30:22 -06:00
Mitchell Hashimoto
6c529c92f2 Merge pull request #1217 from widberg/main
Windows Fixes
2024-01-04 19:48:28 -08:00
Mitchell Hashimoto
38c5258d6e termio/exec: small change 2024-01-04 19:48:08 -08:00
widberg
2e79b5c63d Use cmd.exe instead of sh on Windows 2024-01-04 21:24:24 -05:00
Collin Dickert
8a2a849cc8 add CodeNewRoman Nerd Font to quirks 2024-01-04 21:15:12 -05:00
Krzysztof Wolicki
3297c3958c Merge branch 'main' of github.com:mitchellh/ghostty 2024-01-04 23:37:24 +01:00
Krzysztof Wolicki
0842e572df Update usage of testing.expectEqual 2024-01-04 13:30:34 +01:00
Troels Thomsen
d3a7f9baf5 Resolve path relative to base 2024-01-03 23:27:22 +01:00
Krzysztof Wolicki
1913243c35 WIP: Update to new build module API after Zig PR #18160
Temporarily change dependency sources to forks until they update
2024-01-03 21:50:32 +01:00
Mitchell Hashimoto
a57a32cdb3 config: clarify docs on resetting font-family 2024-01-03 09:43:24 -08:00
Mitchell Hashimoto
8dd8bae0cd config: empty value for RepeatableString resets the list 2024-01-03 09:35:03 -08:00
Mitchell Hashimoto
b4f403f152 font-family settings are repeatable to specify fallback 2024-01-03 09:30:12 -08:00
Mitchell Hashimoto
98237b112f config: RepeatableString is null-terminated now
This makes it easier for these values to interface with C APIs
2024-01-03 09:24:15 -08:00
Jeffrey C. Ollie
f4292bccfc replace deprecated std.mem.tokenize with std.mem.tokenizeScalar 2024-01-03 10:22:33 -06:00
Mitchell Hashimoto
5091655558 Merge pull request #1202 from gpanders/cell-color-refactor
terminal: track palette color in cell state
2024-01-02 20:58:32 -08:00
Gregory Anders
060bdff117 terminal: track palette color in cell state
Rather than immediately converting a color palette index into an RGB
value for a cell color, when a palette color is used track the palette
color directly in the cell state and convert to an RGB value in the
renderer.

This causes palette color changes to take effect immediately instead of
only for newly drawn cells.
2024-01-02 22:34:06 -06:00
Mitchell Hashimoto
797da2f737 termio/exec: avoid potential deadlock with surface message
Fixes #1198

This adds a fix similar to what we discovered with termio messages: we
attempt to send a surface message but if the queue is full we unlock the
terminal state and try again waiting forever.

In all cases, its safe to unlock the mutex while sending the message, no
scenario we send a surface message requires this lock to be held.
2024-01-02 15:34:20 -08:00
Mitchell Hashimoto
acba69a4ce Merge pull request #1193 from vancluever/vancluever/gtk-x11-modifier-state
apprt/gtk: ensure modifier state matches current keypress under X11
2024-01-01 08:35:14 -08:00
Mitchell Hashimoto
732063375a apprt/gtk: stylistic changes 2024-01-01 08:34:19 -08:00
Chris Marchesi
d235554606 apprt/gtk: Move Xkb state to App, remove un-needed fields, style changes 2023-12-31 12:10:25 -08:00
Mitchell Hashimoto
a3ce446fee apprt/gtk: use some comptime to load X11 functions 2023-12-31 08:00:43 -08:00
Mitchell Hashimoto
3b7e83150f apprt/gtk: stylistic changes 2023-12-31 07:50:36 -08:00