6734 Commits

Author SHA1 Message Date
Qwerasd
55c1ef779f fix(Metal): interpolate kitty images
uint textures can't be interpolated apparently
2025-05-14 21:12:20 -06:00
Mitchell Hashimoto
a74e352726 bench: add --mode=gen-osc to generate synthetic OSC sequences
This commit adds a few new mode flags to the `bench-stream` program
to generator synthetic OSC sequences. The new modes are `gen-osc`,
`gen-osc-valid`, and `gen-osc-invalid`. The `gen-osc` mode generates
equal parts valid and invalid OSC sequences, while the suffixed variants
are for generating only valid or invalid sequences, respectively.

This commit also fixes our build system to actually be able to build the
benchmarks. It turns out we were just rebuilding the main Ghostty binary
for `-Demit-bench`. And, our benchmarks didn't run under Zig 0.14, which
is now fixed.

An important new design I'm working towards in this commit is to split
out synthetic data generation to a dedicated package in
`src/bench/synth` although I'm tempted to move it to `src/synth` since
it may be useful outside of benchmarks.

The synth package is a work-in-progress, but it contains a hint of
what's to come. I ultimately want to able to generate all kinds of
synthetic data with a lot of knobs to control dimensionality (e.g. in
the case of OSC sequences: valid/invalid, length, operation types,
etc.).
2025-05-14 12:26:31 -07:00
Weizhao Ouyang
528814da79 url: restrict file paths regex to one slash
This restricts the valid path prefixes to prevent false matches caused
by literal dot.

Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
2025-05-14 23:20:09 +08:00
Jeffrey C. Ollie
ba08b0cce5 gtk custom bell audio: optional -> required 2025-05-13 10:01:54 -05:00
Jeffrey C. Ollie
0e8b266662 Use std.math.clamp
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2025-05-13 10:01:54 -05:00
Jeffrey C. Ollie
8d0c3c7b7c gtk: implement custom audio for bell 2025-05-13 10:01:54 -05:00
Mitchell Hashimoto
507e808a7c input: add backwards compatible alias for plus to +
From #7320
Discussion #7340

There isn't a `physical` alias because there is no physical plus key
defined for the W3C keycode spec.
2025-05-12 15:32:32 -07:00
Mitchell Hashimoto
ecda5ec327 macos: do not send UTF-8 PUA codepoints to key events
Fixes #7337

AppKit encodes functional keys as PUA codepoints. We don't want to send
that down as valid text encoding for a key event because KKP uses that
in particular to change the encoding with associated text.

I think there may be a more specific solution to this by only doing this
within the KKP encoding part of KeyEncoder but that was filled with edge
cases and I didn't want to risk breaking anything else.
2025-05-12 11:42:05 -07:00
Mitchell Hashimoto
6c6cdf4c4f input: bracket right was mapped to left, a typo 2025-05-12 09:57:10 -07:00
Mitchell Hashimoto
8f40d1331e ensure ctrl++ parses, clarify case folding docs 2025-05-12 09:08:00 -07:00
Mitchell Hashimoto
c4f1c78fcf macOS: treat C-/ specially again to prevent beep
Fixes #7310
2025-05-11 07:15:46 -07:00
Mitchell Hashimoto
ed1194cd75 fix tests 2025-05-10 08:51:08 -07:00
Mitchell Hashimoto
1752edd9eb input: implement case folding for binding matching 2025-05-10 07:22:44 -07:00
Mitchell Hashimoto
ca2ead9647 input: kitty add missing numpad keycodes since we support those now 2025-05-09 11:09:22 -07:00
Mitchell Hashimoto
ebabdb322c input: ignore control characters for backspace/enter/escape special case 2025-05-09 11:05:42 -07:00
Mitchell Hashimoto
293a67cd01 input: control-encode right control properly 2025-05-09 10:16:21 -07:00
Mitchell Hashimoto
54bd701ba9 input: bindings should match on single-codepoint utf-8 text too 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
d015efc87d clean up bindings so that they match macOS menus 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
5962696c3b input: remove physical_key from the key event (all keys are physical) 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
11a623aa17 docs 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
cc748305fb input: w3c names for keys 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
1e76222f19 update docs 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
7983e0d62c input: backwards compatibility 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
ffdf86374a apprt/gtk: build 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
b991d36343 macOS: build 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
24d433333b apprt/glfw: builds 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
a3462dd2bd input: remove translated 2025-05-09 10:01:05 -07:00
Mitchell Hashimoto
91d15c89bc input: key enum is now aligned with W3C keyboard codes 2025-05-09 10:01:05 -07:00
Jeffrey C. Ollie
9c70f8aee1 core: add context menu key 2025-05-07 13:08:38 -07:00
tangowithfoxtrot
69a744b521 docs: fix minor grammatical error 2025-05-07 11:46:36 -07:00
Jeffrey C. Ollie
0ed4b5d9c6 gtk: only allow one config error dialog at a time (#7293)
This fixes a problem introduced by #7241 that would cause multiple error
dialogs to be shown.
2025-05-07 13:36:17 -05:00
Jeffrey C. Ollie
5d81a31a49 gtk: remove dead code 2025-05-07 11:12:07 -05:00
Jeffrey C. Ollie
00a2d54420 gtk: only allow one config error dialog at a time
This fixes a problem introduced by #7241 that would cause multiple error
dialogs to be shown.
2025-05-07 10:46:46 -05:00
Mitchell Hashimoto
362c5cb05f Allow struct/union/enum binding types to have default values
This allows for `keybind = super+d=new_split` to now work (defaults to
"auto"). This will also let us convert void types to union/enum/struct
types in the future without breaking existing bindings.
2025-05-07 08:18:28 -07:00
Jeffrey C. Ollie
e8c845b758 core: fixup callconv(.C) -> callconv(.c)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:41:09 -05:00
fn ⌃ ⌥
071531c5c5 Add "Scroll to Selection" command 2025-05-06 16:26:22 -07:00
Jeffrey C. Ollie
27cdd6d79c gtk: require blueprint-compiler 0.16 for building (#6827)
Changes:

1. Require `blueprint-compiler` 0.16.0 (or newer) for building from a
git checkout. With #6822 distributions that can't meet that requirement
can use generated source tarballs to build.
2. Remove all `.ui` files as they are unnecessary.
3. Simplify the `Builder` interface since raw `.ui` files are no longer
used.
4. Removed build-time check of raw `.ui` files.
2025-05-06 16:06:53 -05:00
Leorize
b6f120a749 termio, flatpak: support spawning terminals in cwd
Implements path access testing for Flatpak via test spawning. This is
required since Flatpak reserves certain paths from being accessible
regardless of permissions.

Ref: https://docs.flatpak.org/en/latest/sandbox-permissions.html#reserved-paths
2025-05-06 13:42:14 -07:00
Mitchell Hashimoto
702c3f58d9 font/freetype: introduce mutexes to ensure thread safety of Library and Face (#7238)
tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for
thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need
the face to be locked for thread safety, since we're sharing faces
across threads.

For details see comments and FreeType docs @
-
https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library
-
https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face

---

This might resolve the issue discussed in #7016 but I wasn't able to
reliably reproduce it in a way I could debug, so someone who was
experiencing it should probably test this PR.

Additionally I can still semi-reliably produce a crash with the GTK
apprt by setting an `all:` keybind to adjust font sizes and changing the
font size rapidly with many surfaces open with emojis on them.
Unfortunately I can't really tell what the root cause is because the
debug info is broken in QEMU.

However, I do think this is a good idea for us to be thread safe with
this stuff even if it isn't related to that problem.
2025-05-06 07:18:11 -07:00
Mitchell Hashimoto
f73f7c805d Fix removed GDK_DEBUG gl-no-fractional (#7233)
`gl-no-fractional` is removed from GTK v4.17.5
2025-05-06 07:17:28 -07:00
Mitchell Hashimoto
050e40a29d Implement dark/light theme filtering in theme preview (#7248)
This pr closes https://github.com/ghostty-org/ghostty/issues/7235

Demo:


https://github.com/user-attachments/assets/88366ac7-fcdb-49e9-bed7-8deb0eebeb9e
2025-05-06 07:16:46 -07:00
Mitchell Hashimoto
7ce828253a bash: explicitly request a login shell (#7253)
Prior to #7044, on macOS, our shell integrated command line would be
executed under `exec -l`, which caused bash to be started as a login
shell. Now that we're using direct command execution, add `--login` to
our bash command's arguments on macOS to get that same behavior.
2025-05-06 07:16:09 -07:00
Jeffrey C. Ollie
1bf686d324 gtk: fix comment about adwaita version 2025-05-06 08:44:52 -05:00
Jon Parise
37974dba06 bash: explicitly request a login shell
Prior to #7044, on macOS, our shell integrated command line would be
executed under `exec -l`, which caused bash to be started as a login
shell. Now that we're using direct command execution, add `--login` to
our bash command's arguments on macOS to get that same behavior.
2025-05-05 10:26:37 -04:00
Qwerasd
5319d38366 fix(tests): correctly deinit font faces 2025-05-01 18:37:47 -06:00
Qwerasd
cfedd477b2 font/freetype: introduce mutexes to ensure thread safety of Library and Face
For details see comments and FreeType docs @
https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library
https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face

tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for
thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need
the face to be locked for thread safety, since we're sharing faces
across threads.
2025-05-01 18:22:37 -06:00
Maciej Bartczak
418c46538c use enum for the color scheme args 2025-05-01 19:41:02 +02:00
Maciej Bartczak
0b5160e9f0 implement dark/light theme filtering in theme preview 2025-05-01 19:02:34 +02:00
Mitchell Hashimoto
6e11d947e7 Binding for toggling window float on top (macOS only)
This adds a keybinding and apprt action for #7237.
2025-05-01 09:47:17 -07:00
Leorize
0af5a291ac apprt/gtk: ensure configuration is loaded on startup
Restores the app configuration code removed in
https://github.com/ghostty-org/ghostty/pull/6792.

The was unnoticed due to `colorSchemeEvent` triggering a
configuration reload if `window-theme` deviates from the default
(i.e. dark mode is used).

Fixes https://github.com/ghostty-org/ghostty/discussions/7206
2025-05-01 01:59:36 -05:00