141 Commits

Author SHA1 Message Date
Daniel Patterson
5ad2ec8f71 Add chorded/sequenced keybinds to +list-keybinds output 2025-01-24 19:58:15 +00:00
Anund
098a46f077 docs: generate mdx file for cli actions 2025-01-23 15:58:33 -08:00
Anund
168dd31367 documentation: consistent format for actions help 2025-01-23 15:58:33 -08:00
Mitchell Hashimoto
e854b38872 cli: allow renaming config fields to maintain backwards compatibility
Fixes #4631

This introduces a mechanism by which parsed config fields can be renamed
to maintain backwards compatibility. This already has a use case --
implemented in this commit -- for `background-blur-radius` to be renamed
to `background-blur`.

The remapping is comptime-known which lets us do some comptime
validation. The remap check isn't done unless no fields match which
means for well-formed config files, there's no overhead.

For future improvements:

- We should update our config help generator to note renamed fields.
- We could offer automatic migration of config files be rewriting them.
- We can enrich the value type with more metadata to help with
  config gen or other tooling.
2025-01-23 14:16:37 -08:00
Leah Amelia Chen
f2c357a209 config: allow booleans for background-blur-radius 2025-01-05 12:27:11 -08:00
Leah Amelia Chen
31439f311d build: add wayland 2025-01-05 12:27:11 -08:00
Bryan Lee
9fa404c390 Ensure all search results are visible in theme list
When searching in the theme list (e.g., searching for "Snazzy"), some matching themes might be hidden due to incorrect window position handling.

This fix ensures all matching themes are visible by adjusting the window position logic.
2025-01-03 16:24:53 +08:00
Jeffrey C. Ollie
3c93f00d04 cli: only print out DE when using the GTK apprt 2025-01-02 18:29:33 -06:00
Jeffrey C. Ollie
5c39d09053 core: detect what desktop environment the user is using 2025-01-02 18:29:31 -06:00
Tim Visher
57ace2d0b8 Clarify CLI vs. Keybind Actions documentation
https://github.com/ghostty-org/ghostty/discussions/4107#discussioncomment-11699228
2025-01-01 12:34:55 -05:00
GoProSlowYo
c8c3fb2900 Fix typo in list-themes browser
Signed-off-by: GoProSlowYo <68455785+goproslowyo@users.noreply.github.com>
2024-12-29 09:39:46 -08:00
Jeffrey C. Ollie
8ecb11a602 gtk: add option to not link against libX11 2024-12-28 13:40:17 -06:00
Tim Culverhouse
c2792a1811 cli(list_themes): ignore .DS_Store
macOS will create `.DS_Store` files in any directory it opens in Finder.
The `+list_themes` command would then list this file as a theme, and
attempt to preview it. `.DS_Store` is a binary file, and is silently
failing in the theme preview...I am on Linux and when I put a small
binary file in my user themes directory, I get a segfault. There is
something about the specific contents in `.DS_Store` that does not cause
this segfault, but lets us silently fail. We should investigate this
further - the issue is in `Config.loadFile` I believe.

In either case, we need to ignore `.DS_Store` so that it is not listed
as a theme.

Fixes: #3378
2024-12-27 09:00:08 -06:00
Joris Guex
73367a55f6 Fix docs formatting 2024-12-27 11:45:42 +08:00
Mitchell Hashimoto
bef28524dc CLI: add +show-face action (#3000)
This adds a `+show-face` CLI action to show what font face Ghostty will
use to display a particular codepoint. The codepoint can either be
specified via a single integer or via UTF-8 encoded string.

![Screenshot From 2024-12-17
12-32-31](https://github.com/user-attachments/assets/5a47e672-5ea2-4463-a1dc-7cd6d897e0a8)
2024-12-22 07:25:10 -08:00
Mitchell Hashimoto
8f15f1a066 Make Ghostty release channel aware
Ghostty now has a release channel build configuration. Current valid
values are "tip" and "stable" but I imagine more will be added in the
future.

The release channel is inferred whether the version we specify with the
`-Dversion-string` build flag has a prerelease tag or not. If it does,
the release channel is "tip". If it doesn't, the release channel is
"stable".

This also adds a configuration to specify the release channel for
auto-updates for the macOS application.
2024-12-20 14:21:59 -08:00
Jeffrey C. Ollie
82e67430cd cli: add +show-face CLI action
This CLI action shows what font face Ghostty will use to display
a particular codepoint.
2024-12-17 13:09:32 -06:00
Jeffrey C. Ollie
813c48cb12 core: allow u21 as a cli argument type 2024-12-17 13:08:48 -06:00
Jeffrey C. Ollie
97a2b94c9b core: allow cli actions to use arg parsing diagnostics 2024-12-17 13:07:48 -06:00
Anund
c7deea6a7f zsh: add completions generation 2024-12-11 21:11:38 +11:00
Mitchell Hashimoto
5b01cb353d config: need to dupe filepath for diagnostics
Fixes #2800

The source string with the filepath is not guaranteed to exist beyond
the lifetime of the parse operation. We must copy it.
2024-11-27 08:46:47 -08:00
Mitchell Hashimoto
2e939b617e config: clone should copy diagnostics
Fixes #2800
2024-11-26 15:13:32 -08:00
Mitchell Hashimoto
4ef2240618 cli: parseCLI for optionals should not be null in release modes
Fixes #2747

I admit I don't fully understand this. But somehow, doing `var x: ?T =
undefined` in release fast mode makes `x` act as if its unset. I am
guessing since undefined does nothing to the memory, the memory layout
is such that it looks null for zeroed stack memory. This is a guess.

To fix this, I now initialize the type `T` and set it onto the optional
later. This commit also fixes an issue where calling `parseCLI` multiple
times on an optional would not modify the previous value if set.
2024-11-20 19:05:52 -08:00
Mitchell Hashimoto
7d2dee2bc3 cli: parseCLI form works with optionals 2024-11-19 11:05:20 -08:00
Mitchell Hashimoto
d2cdc4f717 cli: parse auto structs 2024-11-19 10:46:25 -08:00
furtidev
8901027e6d fix: theme search ranking is now case insensitive 2024-11-16 20:05:11 +06:00
furtidev
fb2510c2ed fix: +list-themes crashing when there's search result is empty 2024-11-16 20:03:58 +06:00
furtidev
a6bdd2f201 port +list-themes to latest libvaxis 2024-11-16 20:02:35 +06:00
furtidev
e7b9a2ac95 port +list-keybinds to latest libvaxis 2024-11-16 19:39:48 +06:00
Mitchell Hashimoto
bb60190630 update zf api 2024-11-12 19:15:25 -08:00
Mitchell Hashimoto
72659d48ac Merge pull request #2637 from jcollie/core-list-valid-enums
core: list valid options if an invalid value is detected parsing an enum
2024-11-09 11:57:10 -08:00
Mitchell Hashimoto
8b2980284d Merge pull request #2636 from jcollie/unifi-adwaita
core/gtk: unify libadwaita/adwaita options in the code
2024-11-09 11:56:58 -08:00
Jeffrey C. Ollie
3eef6d205e core: address review comments
- break formatting values out into a function so that we can
  catch errors and never fail
- eliminate the use of toOwnedSentinelSlice since we are using
  an arena to clean up memory
2024-11-09 12:49:40 -06:00
Pepper Lebeck-Jobe
3c493f2d0d Fix copying the theme name
Prior to this change both C and c would copy the path to the theme even though
the help screen claimed that c would copy the theme name.

There is a bug in libvaxis that results in both of these matches matching c:
  `key.matches('c', .{})`
	`key.matches('c', .{ .shift = true })`

Tested:
  Before the change: 'c' copies path and 'C' copies path
  After the change: 'c' copies the name and 'C' copies the path
2024-11-09 10:10:29 +01:00
Jeffrey C. Ollie
ca844ca3c0 core: list valid options if an invalid value is detected parsing an enum 2024-11-08 22:32:14 -06:00
Jeffrey C. Ollie
b353ddf46d core/gtk: unify libadwaita/adwaita options in the code
Fixes #2574
2024-11-08 22:19:04 -06:00
Mitchell Hashimoto
b11b5871e9 cli: do not parse actions (+command) after -e
Fixes #2506
2024-10-30 20:56:53 -04:00
Anmol Wadhwani
70d850f8e4 make selection a const 2024-10-27 21:40:25 +05:30
Anmol Wadhwani
9190dd3ad7 Add an out of bounds check for mouse-selected themes in +list-themes 2024-10-27 20:51:21 +05:30
Mitchell Hashimoto
fc6eda6623 cli: +help needs to use the proper args iterator 2024-10-19 10:43:08 -07:00
Mitchell Hashimoto
c90ed29341 cli: skip argv0 and actions when parsing CLI flags
This fixes a regression from #2454. In that PR, we added an error when
positional arguments are detected. I believe that's correct, but we
were silently relying on the previous behavior in the CLI commands.

This commit changes the CLI commands to use a new argsIterator function
that creates an iterator that skips the first argument (argv0). This is
the same behavior that the config parsing does and now uses this shared
logic.

This also makes it so the argsIterator ignores actions (`+things`)
and we document that we expect those to be handled earlier.
2024-10-18 12:59:16 -07:00
Mitchell Hashimoto
940a46d41f cli: positional arguments are invalid when parsing configuration 2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
4e25840e08 apprt/gtk: support new config diagnostics API 2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
70c175e2a6 c: remove the config load string API
It was unused and doesn't match our diagnostic API.
2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
a12b33662c config: track the location of CLI argument errors 2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
f24098cbd8 config: show filepath and line numbers for config errors
Fixes #1063
2024-10-18 08:11:11 -07:00
Mitchell Hashimoto
a4e14631ef config: richer diagnostics for errors
Rather than storing a list of errors we now store a list of
"diagnostics." Each diagnostic has a richer set of structured
information, including a message, a key, the location where it occurred.

This lets us show more detailed messages, more human friendly messages, and
also let's us filter by key or location. We don't take advantage of
all of this capability in this initial commit, but we do use every field
for something.
2024-10-18 08:11:11 -07:00
Rick Calixte
d0316b746d list_fonts and list_keybinds: Fix typos in documentation
test.yml: Switch to Windows Server 2022 and update Zig URL
2024-10-16 22:56:16 -04:00
Jeffrey C. Ollie
f645d6962b cli: add GTK & libadwaita version info
If the apprt is GTK add the GTK and the libadwaita version info to the
`+version` action. This information is available in the log but it may
be more accessible here.
2024-10-15 14:48:34 -05:00
Mitchell Hashimoto
ed2cd6d436 macos: remove the ability to bind fn/globe
This was recently introduced a few days ago. Unfortunately, this doesn't
work as expected. The "function" modifier is not actually the fn key
but used by macOS to represent a variety of "functional" key presses.
This breaks other bindings such as #2411.

I can't find a source on the internet that reliably tells me how we
can detect fn key presses, but I do find a number of sources that tell
us we can't.
2024-10-07 14:36:12 -10:00