10271 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
7f9bb3c0e5 update PACKAGING.md to be explicit about source vs. git (#7317)
Related to #7316

I'm not going to close the issue yet because I want to also update the
website, but this should help clarify things more. I noticed the README
already makes a distinction, thankfully.
2025-05-09 08:54:02 -07:00
Mitchell Hashimoto
201ea050bd update PACKAGING.md to be explicit about source vs. git
Related to #7316
2025-05-09 08:27:15 -07:00
Mitchell Hashimoto
bcff488095 core: add context menu key (#5162)
I have this key on a cheap Lenovo keyboard at work and would like to put
it to some use.
2025-05-07 13:25:18 -07:00
Jeffrey C. Ollie
9c70f8aee1 core: add context menu key 2025-05-07 13:08:38 -07:00
Jeffrey C. Ollie
73ec7e5f10 docs: fix minor grammatical error (#7295)
Fixes a small grammatical error in the config docs.
2025-05-07 14:18:50 -05: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
Mitchell Hashimoto
c36314ca98 Allow struct/union/enum binding types to have default values (#7291)
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 09:50:44 -07: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
Mitchell Hashimoto
f6bb1f5e34 core: fixup callconv(.C) -> callconv(.c) (#7289)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:08:51 -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
Mitchell Hashimoto
35c9d32e69 Add "Scroll to Selection" command (#7265)
This is mostly intended for implementing the "Jump to Selection"
(<kbd>⌘</kbd> <kbd>J</kbd>) command on macOS (but as per the TODO, the
pin still needs to be centered)

Demo: (Selected text is "10")

<table><tr>
<td><img width="965" alt="Screenshot 2025-05-03 at 9 21 55 AM"
src="https://github.com/user-attachments/assets/c37ba0b7-f622-48d2-b598-4151e85377ef"
/></td>
<td><img width="965" alt="Screenshot 2025-05-03 at 9 21 58 AM"
src="https://github.com/user-attachments/assets/650f44f9-3125-4a2a-b264-a6e8476e4fcb"
/></td>
</tr></table>
2025-05-06 16:44:21 -07:00
fn ⌃ ⌥
071531c5c5 Add "Scroll to Selection" command 2025-05-06 16:26:22 -07:00
Mitchell Hashimoto
eb7368699b macOS: move window title handling fully to AppKit, fix command palette losing title (#7283)
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.

The prior `focusedValue`-based code was a relic of when Ghostty was a
full SwiftUI app. Now that we have AppKit in the mix (and have for a
couple years), we shouldn't bolt on fixes to that cruft if we can help
it.
2025-05-06 15:13:04 -07:00
Mitchell Hashimoto
2caa8a3fe1 macOS: move window title handling fully to AppKit
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.
2025-05-06 14:57:19 -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
Mitchell Hashimoto
5f8a0dc4a0 termio, flatpak: support spawning terminals in cwd (#6915)
Implements path access testing for Flatpak via test spawning. This is
required since Flatpak reserves certain paths from being accessible
regardless of permissions.

Opened mostly as an RFC, this approach seems to work without any
noticeable performance impact.

Ref:
https://docs.flatpak.org/en/latest/sandbox-permissions.html#reserved-paths
2025-05-06 13:59:48 -07:00
Mitchell Hashimoto
732500b418 feat: implement toggleMaximize for macOS (#7191)
Resolve #7030
2025-05-06 13:43:57 -07: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
e5765dfa79 macOS: save/restore firstResponder on non-native fullscreen (#7279)
Fixes #6999
Supersedes #7201 

It appears that at some point one of the operations causes focus to move
away for non-native fullscreen. We previously relied on the delegate
method to restore this but a better approach appears to handle this
directly in the fullscreen implementations. This fixes the linked issue.

I still think long term all the `Ghostty.moveFocus` stuff is a code
smell and we should be auditing all that code to see if we can eliminate
it. But this is a step in the right direction, and removes one of those
uses.
2025-05-06 13:32:33 -07:00
Mitchell Hashimoto
e2a0f439c6 macOS: save/restore firstResponder on non-native fullscreen
Fixes #6999

It appears that at some point one of the operations causes focus to move
away for non-native fullscreen. We previously relied on the delegate
method to restore this but a better approach appears to handle this
directly in the fullscreen implementations. This fixes the linked issue.

I still think long term all the `Ghostty.moveFocus` stuff is a code
smell and we should be auditing all that code to see if we can
eliminate it. But this is a step in the right direction, and removes one
of those uses.
2025-05-06 12:59:31 -07:00
Mitchell Hashimoto
d0a8cb671b macOS: handle scenario cgWindowId is nil (#7277)
Fixes #7114
Supercedes #7271

This fixes a crash that could occur with non-native fullscreen and
`fullscreen = true` set at once.

The "windowNumber" can be `<= 0` if the window "doesn't have a window
device." I don't fully know all the scenarios this is true but it is
true when the window is not visible, at least.
2025-05-06 10:50:14 -07:00
Mitchell Hashimoto
9b78917246 macOS: handle scenario cgWindowId is nil
Fixes #7114
Supercedes #7271

This fixes a crash that could occur with non-native fullscreen and
`fullscreen = true` set at once.

The "windowNumber" can be `<= 0` if the window "doesn't have a
window device." I don't fully know all the scenarios this is true but it
is true when the window is not visible, at least.
2025-05-06 10:33:56 -07:00
Mitchell Hashimoto
a4bd6efcbf ci: add flatpak JSON for iterm2 theme updates (#7275)
I forgot to add the path in the GitHub action.
2025-05-06 09:51:08 -07:00
Mitchell Hashimoto
9221d392de ci: add flatpak JSON for iterm2 theme updates
I forgot to add the path in the GitHub action.
2025-05-06 07:20:56 -07:00
Mitchell Hashimoto
3c405a591a update flatpak cache 2025-05-06 07:19:40 -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
Mitchell Hashimoto
e2b5bfb5b0 gtk: fix comment about adwaita version (#7274) 2025-05-06 07:04:32 -07:00
Mitchell Hashimoto
f13d74bcf0 improvements to the Issue Triage Discussion template (#7266)
After some time with the initial template and Discussions being created,
there are some improvements we should make to the Issue Triage template.

Most of these changes were discussed in #7012 and among helpers in the
Discord.

~~I've marked this as a Draft for now as I work with the helpers to
confirm how we want to approach a few of the outstanding changes, mostly
minor updates.~~

As always, you can test these out by [opening an Issue Triage Discussion
post on my
fork](https://github.com/taylrfnt/ghostty/discussions/new?category=issue-triage).
2025-05-06 06:57:36 -07:00
Mitchell Hashimoto
b346f06a51 Update iTerm2 colorschemes (#7268)
Upstream revision:
1e4957e650
2025-05-06 06:56:49 -07:00
Jeffrey C. Ollie
1bf686d324 gtk: fix comment about adwaita version 2025-05-06 08:44:52 -05:00
taylrfnt
ac11ebbb4a update applied label to proper name
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:37:49 -05:00
taylrfnt
ad0d426bba consistent spacing with tip & important highlights
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:36:38 -05:00
taylrfnt
d0b9242f49 replace dashes with code block backticks for additional config
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:34:33 -05:00