10297 Commits

Author SHA1 Message Date
Aaron Ruan
f343e1ba46 Fix comma typo 2025-05-16 00:40:25 +08:00
Aaron Ruan
f6d56f4f03 Handle check_for_updates as unimplemented action 2025-05-15 23:26:47 +08:00
Aaron Ruan
7ccc181332 macos: add "Check for Updates" action, menu item & key-binding support 2025-05-15 13:34:44 +08:00
Mitchell Hashimoto
a090e8eeed url: restrict file paths regex to one slash (#7355)
Fixes https://github.com/ghostty-org/ghostty/discussions/7351.

This restricts the valid path prefixes to prevent false matches caused
by literal dot.
2025-05-14 10:32:08 -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
Mitchell Hashimoto
6984b1ec48 input: add backwards compatible alias for plus to + (#7342)
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:39:39 -07: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
7dc65adb1f snap: Build with cpu=baseline as documented in PACKAGING.md (#7341)
Ensures baseline instruction set
2025-05-12 15:07:03 -07:00
Ken VanDine
e2daf04cba snap: Build with cpu=baseline as documented in PACKAGING.md 2025-05-12 17:40:48 -04:00
Mitchell Hashimoto
00829ca2cc macos: do not send UTF-8 PUA codepoints to key events (#7338)
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:45:04 -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
6723c308be input: bracket right was mapped to left, a typo (#7334)
From #7320
2025-05-12 10:00:17 -07:00
Mitchell Hashimoto
6c6cdf4c4f input: bracket right was mapped to left, a typo 2025-05-12 09:57:10 -07:00
Mitchell Hashimoto
3f54601df0 Use W3C key code specification for keybindings (Breaking Change) (#7320)
Fixes #7315
Fixes #7314 
Fixes #7310 
Fixes #7309

**This PR has breaking changes, noted later.**

This changes our internal key events to match the [W3C key event code
specification](https://www.w3.org/TR/uievents-code/). With these
changes, apprts are expected to produce key codes within that spec and
everything follows from there. This gives us a standard cross-platform
keycode behavior.

Previously, due to our history, we based our key codes on GLFW and Linux
more generally (since Ghostty was on Linux first). This served us
surprisingly well through today, but has been riddled with various
issues (many fixed, but note how many bugs this PR is fixing). From a
user experience perspective, it also caused confusion about how
Ghostty's keybinds interact with keyboard layouts which led to various
complicated features like `physical:` (which is removed in this PR).

## Overview of Changes

* `physical:` is now gone. Physical keys are now specified by the W3C
key codes. Example: `ctrl+KeyA` will always match the "a" key on a US
physical layout (the name `KeyA` lining up with US keyboards is mandated
by the spec, not us). Note when we say "physical" here we mean the
keycode sent by the OS or GUI framework; these can often be overridden
using programs to remap keys at the "hardware" level but software
layouts do not do this.

* All single codepoint characters match the character produced by the
keyboard layout (i.e. are layout-dependent). So `ctrl+c` matches the
physical "c" key on a US standard keyboard with a US layout, but matches
the "i" key on a Dvorak layout. This also works for international
characters. Codepoints are case-insensitive and match via Unicode case
folding (this is how both Windows and macOS treat keyboard shortcuts).

* W3C key names replace all previous non-character names and always
match _physical keys_. For example, `ctrl+grave_accent` (Ghostty 1.1x)
is now `ctrl+backquote` to match the W3C spec. This PR maintains
backwards compatibility so the old values are aliased to the new values.

* W3C key names can be both snake case and match the spec exactly. e.g.
`KeyA` and `key_a` are both valid. This is an aesthetic choice, because
I think the capitalization is really ugly. We have tests to verify this
mapping so its officially supported.

* Because we support W3C keys, we now support significantly more media
keys such as `context_menu`, `browser_home` and so many more. These work
as long as your OS and keyboard can produce the valid key codes.

## Breaking Changes

* Key names have changed, e.g. `grave_accent` is now `backquote`. The
new names are all W3C standard. There are backwards compatible aliases,
so **old configurations will still work.** But the `+list-keybinds` CLI
will always output the new versions.

* `physical:` is gone, all W3C names are always physical and all code
points are always logical. There are backwards compatible aliases for
unambiguous keys, so **most old configurations will still work.** If
there is ambiguity, old configurations will error, but I don't expect
this to be common at all.

* Physical keybinds always take priority over logical keybinds. This was
_inconsistent_ before. Physical keybinds are relatively rare so I don't
think this will impact people but just noting this is not an explicit,
tested, documented behavior.
2025-05-12 09:18:28 -07:00
Mitchell Hashimoto
8f40d1331e ensure ctrl++ parses, clarify case folding docs 2025-05-12 09:08:00 -07:00
Mitchell Hashimoto
0eebebb75e Update iTerm2 colorschemes (#7326)
Upstream revision:
93eb37fadd
2025-05-11 14:45:30 -07:00
Mitchell Hashimoto
c4f1c78fcf macOS: treat C-/ specially again to prevent beep
Fixes #7310
2025-05-11 07:15:46 -07:00
mitchellh
db1608ff16 deps: Update iTerm2 color schemes 2025-05-11 00:14:21 +00: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
a26310e83f macOS: app key is binding check should include utf-8 chars 2025-05-09 10:45:43 -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
5dc88bda6a macOS: send proper UTF-8 text for more key events 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
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