8161 Commits

Author SHA1 Message Date
Marijn Besseling
4496e7d314 implement overline decoration (SGR 53/55) 2024-10-21 08:36:08 -04:00
Ethan Johnson
a53b4f684e Merge branch 'ghostty-org:main' into macos-window-deocrations-rework 2024-10-19 20:40:44 -04:00
johnseth97
96a0ca613a Fixing deprecation warnings, experiencing new errors. 2024-10-19 18:53:29 -04:00
Mitchell Hashimoto
1134a9cbea Merge pull request #2461 from JoshuaBrest/main
feat: Update MacOS about dialog
2024-10-19 14:16:54 -07:00
Mitchell Hashimoto
85db4d0277 macos: personal nitpicks and improvements 2024-10-19 14:07:04 -07:00
Josh
cc42dc57b9 fix: add text-selection back in the about dialoge. 2024-10-19 11:52:12 -07:00
Josh
d291fcfd52 style: add line break in the caption of the about dialog. 2024-10-19 11:45:24 -07:00
Josh
4b08b3f8d8 refactor: hide buttons when URLs are invalid and change variable mutability and visibility. 2024-10-19 11:23:04 -07:00
Mitchell Hashimoto
fc6eda6623 cli: +help needs to use the proper args iterator 2024-10-19 10:43:08 -07:00
Mitchell Hashimoto
fbe51ff1f5 Merge pull request #2463 from ghostty-org/push-zynwrqnmkryv
macos: clamp window size to screen size on screen parameter changes
2024-10-19 10:18:44 -07:00
Mitchell Hashimoto
70acb0d76e macos: clamp window size to screen size on screen parameter changes
Fixes #2462

This sets up a listener for screen parameter changes. This only triggers
when a screen is added, removed, or a parameter such as its resolution
changes. This doesn't trigger when a window is simply moved from one
screen to another.

On parameter change, we ensure that the window is within the bounds of
the screen. As an exception, if the window was previously already
outside the bounds of the screen, we don't move it back in.
2024-10-19 10:13:16 -07:00
Mitchell Hashimoto
ebe8fb3ab3 Merge pull request #2458 from rockorager/cell-size
fix: report correct screen pixel size
2024-10-19 09:34:40 -07:00
Mitchell Hashimoto
ed1bb5eed3 Merge pull request #2460 from 0xcharly/font-codepoint-map
Tentative fix for unexpected `font-codepoint-map` behavior
2024-10-19 09:34:15 -07:00
Mitchell Hashimoto
05787e7848 Merge pull request #2457 from ghostty-org/push-ztzyoslwwxtu
config: change macos-option-as-alt default to left
2024-10-19 09:31:31 -07:00
Josh
42bf37af32 feat: Update about menu design to match macOS. 2024-10-19 00:31:43 -07:00
Charly Delay
96b4ff39a6 Tentative fix for unexpected font-codepoint-map behavior
In particular when configured to replace several ranges with multiple fonts.

Given the following `font-codepoint-map` config:

```
font-codepoint-map=U+0030-U+0039=Monaco       # 0-9
font-codepoint-map=U+0040=mononoki            # @
font-codepoint-map=U+0041-U+005a=Pixel Code   # A-Z
font-codepoint-map=U+0061-U+007a=Victor Mono  # a-z
```

I noticed a couple of unexpected behavior:

1. Codepoint ranges were assigned the wrong font
2. The declaration order had a direct impact on the font assignment
   (seemed to be rotating in some fashion)

If my understanding of the current implementation is correct, for a
given range index `n` in the `MultiArrayList` `CodepointMap.get(…)`
returns the font descriptor at index `len - n - 1`. In other words, it
returns the descriptor symmetrically opposite relative to the middle of
the list.

I've added a couple test cases that I would expect to pass if my
understanding of the expected behavior is correct, verified that they
were broken under the current behavior, and updated the implementation
of `CodepointMap.get(…)` accordingly.

My understanding of the original intent is to give priority to the
latest range match in the list (which is a use case already tested by
the `codepointmap` test, but which I believe happened to pass "by
accident"), so I opted for a reverse traversal of the codepoint list.
2024-10-19 15:51:08 +09:00
johnseth97
def3a62fb9 Modified window-decorations = none option on macos 2024-10-19 01:03:05 -04:00
Tim Culverhouse
4f1cee8eb9 fix: report correct screen pixel size
Mode 2048 and CSI 14 t are size report control sequences which contain
the text area size in pixels. The text area is defined to be the extents
of the grid (rows and columns). Ghostty calculates the available size
for the text area by setting the available padding, and then filling as
much of the remaining space as possible. However, if there are remainder
pixels these are still reported as part of the text area size.

Pass the cell_size geometry through so that we can always report the
correct value: columns * cell width and rows * cell height.
2024-10-18 22:29:52 -05:00
Mitchell Hashimoto
31b6833ea1 config: change macos-option-as-alt default to left
As suggested: https://github.com/ghostty-org/ghostty/discussions/2363#discussioncomment-10824847

This allows users of non-US keyboard layouts to continue to use the
right option key for input methods, while still being able to use the
the left option key as alt for keybindings.

This is a bit of an experiment to see if this is a good default for
everyone. This is in response to very common confusion of US keyboard
layouts where "alt" doesn't work along with the very common use of
non-US layouts where the right option key is used for input methods.
I think this will strike the right balance for most users.
2024-10-18 14:53:13 -07:00
Mitchell Hashimoto
0084103ff1 Merge pull request #2455 from ghostty-org/push-msknttmmsoxy
cli: skip argv0 and actions when parsing CLI flags
2024-10-18 13:06:22 -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
98a7573ed4 Merge pull request #2454 from ghostty-org/diags
Configuration errors improvements: exit on CLI errors, include line number and filepath
2024-10-18 08:35:13 -07:00
Mitchell Hashimoto
be3fc5c04a apprt/gtk: exit if there are CLI errors 2024-10-18 08:26:27 -07:00
Mitchell Hashimoto
463f4afc05 apprt/glfw: exit with invalid CLI args 2024-10-18 08:21:42 -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
Mitchell Hashimoto
3f1d6eb301 expand explicit error set usage
This continues our work to improve the amount of explicit error sets
we use in the codebase. Explicit error sets make it easier to understand
possible failure scenarios, allow us to use exhaustive matching, create
compiler errors if errors are unexpectedly added or removed, etc.

The goal eventually is 100% coverage but we're not even close yet.
This just moves us a little closer.
2024-10-18 08:10:41 -07:00
Mitchell Hashimoto
913c4b5801 Merge pull request #2450 from qwerasd205/undercurl-min-thickness
font/sprite: undercurl minimum thickness improvement
2024-10-17 19:54:56 -07:00
Qwerasd
2a4398b319 font/sprite: undercurl minimum thickness improvement 2024-10-17 21:07:52 -04:00
Mitchell Hashimoto
d83fce794f Merge pull request #2449 from injust/patch-1
Fix "external affects" typo in documentation
2024-10-17 17:01:38 -07:00
Justin Su
203110355d Fix "external affects" typo in documentation 2024-10-17 14:59:20 -04:00
Mitchell Hashimoto
b38c5876a0 Merge pull request #2448 from rcalixte/quick_typos
list_fonts and list_keybinds: Fix typos in documentation
2024-10-17 06:57:21 -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
Mitchell Hashimoto
7b668d3dc1 Merge pull request #2440 from jcollie/window-theme-ghostty-4-16
gtk: use CSS variables and color calcs introduced in 4.16
2024-10-16 06:24:19 -07:00
Mitchell Hashimoto
c614f2b485 apprt/gtk: use stackfallback for runtime CSS, explicit errors 2024-10-16 06:19:47 -07:00
Mitchell Hashimoto
9d341a9fca Merge pull request #2444 from qwerasd205/quicklook-pos
macOS: fix quicklook position
2024-10-15 16:56:08 -07:00
Mitchell Hashimoto
1d88cd8036 Merge pull request #2445 from jcollie/cli-gtk-version
cli: add GTK & libadwaita version info
2024-10-15 16:47:52 -07: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
Qwerasd
de16541bca macOS: fix quicklook position
Account for padding and properly calculate text baseline, since that is
the position that the NSView `showDefinition` method ultimately needs.
2024-10-15 15:40:15 -04:00
Mitchell Hashimoto
4c871246dd update file sizes in README.md 2024-10-15 09:59:43 -07:00
Mitchell Hashimoto
0b1be01fee Merge pull request #2443 from ghostty-org/push-ktxyxmvpvryw
build: strip symbols from release builds
2024-10-15 09:58:57 -07:00
Mitchell Hashimoto
2bbbdf7433 build: strip symbols from release builds
This significantly reduces the size of the binary.
2024-10-15 09:46:15 -07:00
Mitchell Hashimoto
4c18f1bf4b Merge pull request #2439 from qwerasd205/unicode-16-sprite-font
Excise pixman, use z2d for sprite fonts, refactor box drawing, add new box characters
2024-10-15 09:39:04 -07:00
Mitchell Hashimoto
8a38c87d90 font: use explicit error sets where we can 2024-10-15 09:37:51 -07:00
Mitchell Hashimoto
bb2c8e479d font/sprite: clarify log 2024-10-15 09:30:55 -07:00
Mitchell Hashimoto
dc26a9abe0 nix hash 2024-10-15 09:26:46 -07:00