10841 Commits

Author SHA1 Message Date
dependabot[bot]
adbf834c36 build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: '31'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-21 17:40:25 +00:00
Mitchell Hashimoto
f1c42c9f8c synthetic package
This introduces a new package `src/synthetic` for generating synthetic
data, currently primarily for benchmarking but other use cases can
emerge.

The synthetic package exports a runtime-dispatched type `Generator` that
can generate data of various types. To start, we have a bytes, utf8,
and OSC generator. The goal of each generator is to expose knobs to tune the
probabilities of various outcomes. For example, the UTF-8 generator has
a knob to tune the probability of generating 1, 2, 3, or 4-byte UTF-8
sequences.

Ultimately, the goal is to be able to collect probability data
empirically that we can then use for benchmarks so we can optimize
various parts of the codebase on real-world data shape distributions.
2025-05-21 10:20:09 -07:00
Emir SARI
81647bfae6 Update Turkish translations 2025-05-21 20:06:07 +03:00
Mitchell Hashimoto
4c50a4d487 nix: don't strip if we are building a debug version of the package (#7395) 2025-05-20 06:47:27 -07:00
Mitchell Hashimoto
362d026dba flatpak: Add --device=all permission (#7401)
Without --device=all, the sandbox gets a dedicated PTY namespace.
Commands run on the host via the HostCommand D-Bus interface receive the
file descriptors from the namespaced PTY but cannot determine its path
via ttyname(3). This breaks commands like tty(1), ps(1) and
emacsclient(1).

Add --device=all so the host PTY namespace is used when allocating TTYs.
Applications with access to org.freedesktop.Flatpak can already give
themselves arbitrary permissions, so the sandboxing benefits of
restricted device access are limited. For terminal emulators, the
consistency provided by a cross-distribution runtime and ability to
distribute directly to users is the primary benefit of shipping as a
Flatpak rather than sandboxing.
2025-05-19 21:46:06 -07:00
Liam Hupfer
ae095d2262 flatpak: Add --device=all permission
Without --device=all, the sandbox gets a dedicated PTY namespace.
Commands run on the host via the HostCommand D-Bus interface receive the
file descriptors from the namespaced PTY but cannot determine its path
via ttyname(3). This breaks commands like tty(1), ps(1) and
emacsclient(1).

Add --device=all so the host PTY namespace is used when allocating TTYs.
Applications with access to org.freedesktop.Flatpak can already give
themselves arbitrary permissions, so the sandboxing benefits of
restricted device access are limited. For terminal emulators, the
primary benefit of Flatpak is the predictability of the
distro-independent target runtime rather than sandboxing.
2025-05-19 22:50:07 -05:00
Mitchell Hashimoto
e2df9fa759 build: add unwind tables and frame pointers to debug/test builds (#7398)
This fixes an issue where stack traces were unreliable on some platforms
(namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig
(defaults should be changed?) or what, because this isn't necessary on
other platforms, but this works around the issue.

I've unconditionally enabled this for all platforms, depending on build
mode (debug/test) and not the target. This is because I don't think
there is a downside for other platforms but if thats wrong we can fix
that quickly.

Some binaries have this unconditionally enabled regardless of build mode
(e.g. the Unicode tables generator) because having symbols in those
cases is always useful.

Some unrelated GTK test fix is also included here. I'm not sure why CI
didn't catch this (perhaps we only run tests for none-runtime) but all
tests pass locally and we can look into that elsewhere.

I also updated all our build API calls to be non-deprecated fields.
2025-05-19 19:56:22 -07:00
Mitchell Hashimoto
3d2bc3dca1 build: add unwind tables and frame pointers to debug/test builds
This fixes an issue where stack traces were unreliable on some platforms
(namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig
(defaults should be changed?) or what, because this isn't necessary on
other platforms, but this works around the issue.

I've unconditionally enabled this for all platforms, depending on build
mode (debug/test) and not the target. This is because I don't think
there is a downside for other platforms but if thats wrong we can fix
that quickly.

Some binaries have this unconditionally enabled regardless of build mode
(e.g. the Unicode tables generator) because having symbols in those
cases is always useful.

Some unrelated GTK test fix is also included here. I'm not sure why CI
didn't catch this (perhaps we only run tests for none-runtime) but all
tests pass locally and we can look into that elsewhere.
2025-05-19 17:12:39 -07:00
Jeffrey C. Ollie
9ad0e4675b nix: keep symbols if we're building a debug package
also add CI tests to make sure debug symbols exist

Co-authored-by: Mitchell Hashimoto <m@mitchellh.com>
2025-05-19 18:52:51 -05:00
Alan Moyano
5f3e5afb88 Add Argentinian Spanish translation and locale support 2025-05-19 20:32:30 -03:00
Mitchell Hashimoto
dd5d2c5d0b Add selection-clear-on-typing (#7394)
Fixes #7392

Docs:

> Whether to clear selected text when typing. This defaults to `true`.
> This is typical behavior for most terminal emulators as well as
> text input fields. If you set this to `false`, then the selected text
> will not be cleared when typing.
>
> "Typing" is specifically defined as any non-modifier (shift, control,
> alt, etc.) keypress that produces data to be sent to the application
> running within the terminal (e.g. the shell). Additionally, selection
> is cleared when any preedit or composition state is started (e.g.
> when typing languages such as Japanese).
>
> If this is `false`, then the selection can still be manually
> cleared by clicking once or by pressing `escape`.
2025-05-19 15:37:25 -07:00
Mitchell Hashimoto
ac6aa8d395 Add selection-clear-on-typing
Fixes #7392

Docs:

> Whether to clear selected text when typing. This defaults to `true`.
> This is typical behavior for most terminal emulators as well as
> text input fields. If you set this to `false`, then the selected text
> will not be cleared when typing.
>
> "Typing" is specifically defined as any non-modifier (shift, control,
> alt, etc.) keypress that produces data to be sent to the application
> running within the terminal (e.g. the shell). Additionally, selection
> is cleared when any preedit or composition state is started (e.g.
> when typing languages such as Japanese).
>
> If this is `false`, then the selection can still be manually
> cleared by clicking once or by pressing `escape`.
2025-05-19 13:56:26 -07:00
Mitchell Hashimoto
af293830f3 Update iTerm2 colorschemes (#7378)
Upstream revision:
f979d8b195
2025-05-19 07:13:21 -07:00
Leah Amelia Chen
60d8c42509 gtk: implement global shortcuts (#7083) 2025-05-19 08:18:28 +02:00
Leah Amelia Chen
6827dc0964 config: document global: support on Linux
Compiling this list of known supported and unsupported platforms has been
amazingly painful. Never change, Linux desktop.
2025-05-18 22:40:31 +02:00
Leah Amelia Chen
54dbd1990a gtk: implement global shortcuts
It's been a lot of D-Bus related pain and suffering, but here it is.

I'm not sure about how well this is integrated inside App, but I'm fairly
proud of the standalone logic.
2025-05-18 22:40:31 +02:00
mitchellh
8a0ca1b573 deps: Update iTerm2 color schemes 2025-05-18 00:14:40 +00:00
Leah Amelia Chen
b1af4a597f gtk: implement command palette (#7167)
Closes #7156
2025-05-16 22:16:48 +02:00
Mitchell Hashimoto
a6466c5ca0 macOS: use file parent dir for openTerminal service cwd (#7286) (#7292)
Fixes #7286

Previously, when using the "New Ghostty Window/Tab Here" macOS service
on a file, the new terminal window/tab would incorrectly open in the
user's home directory. This was because the service handler only
expected directory paths.

This commit updates the service handler to check if the provided path is
a file. If it is, the handler now uses the file's parent
directory as the working directory for the new Ghostty window or tab,
aligning with user expectations. If the path is a directory, it's used
directly as before.
2025-05-15 20:20:59 -07:00
Mitchell Hashimoto
2d29fe0494 bench: add --mode=gen-osc to generate synthetic OSC sequences (#7359)
cc @qwerasd205 

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-15 20:19:37 -07:00
Mitchell Hashimoto
e1de7a99e8 macos: add "Check for Updates" action, menu item & key-binding support (#7361)
Resolve #7325
2025-05-15 15:45:24 -07:00
Mitchell Hashimoto
5826b8b142 Gamma correct image scaling (#7368)
Fixes the gamma error noted in #7367 for both Metal and OpenGL by using
sRGB image formats for the textures.

This branch also includes the commits from #7367, so it'd probably be
best to review and merge that first.
2025-05-15 15:36:12 -07:00
Qwerasd
ea79fdea11 fix(OpenGL): use sRGB texture format for gamma correct interpolation
otherwise images will be too dark when scaled
2025-05-15 12:44:44 -06:00
Qwerasd
e2f3b6211f fix(Metal): use sRGB texture format for gamma correct interpolation
otherwise images will be too dark when scaled
2025-05-15 12:44:44 -06:00
Mitchell Hashimoto
1d0cb1a9b0 fix(renderer): Don't force images to grid/cell sizes. (#7367)
Also fixed Metal not interpolating scaled images.

See commit message for more details.

|`main` (Metal)|`main` (OpenGL)|Kitty|fixed (Metal)|fixed (OpenGL)|
|-|-|-|-|-|

|![image](https://github.com/user-attachments/assets/bfe09451-0a41-4952-8a55-5d7a9e5b2813)|![image](https://github.com/user-attachments/assets/70ec6775-ba00-40b7-a32d-dcaaa70671b1)|![image](https://github.com/user-attachments/assets/6d03729b-9b8e-4b25-850d-913e76f6183b)|![image](https://github.com/user-attachments/assets/aedfccf0-220c-4575-b5e4-8b467de6d5df)|![image](https://github.com/user-attachments/assets/300a080a-73f0-4c69-9603-df342767a83f)|

<sup>(Zoom in for details.)</sup>

> [!NOTE]
> This comparison reveals a separate problem we have with image scaling,
which Kitty gets right but we don't -- the interpolation is too dark
because of gamma error, we need to be interpolating in linear space but
instead we're interpolating in gamma compressed space. I'll try to
figure out the best way to resolve this.
2025-05-15 11:42:05 -07:00
Qwerasd
ed207514e9 typo 2025-05-15 11:59:17 -06:00
Qwerasd
709b0214a0 fix(renderer): Don't force images to grid/cell sizes
This problem was introduced by f091a69 (PR #6675).

I've gone ahead and overhauled the placement positioning logic as well;
it was doing a lot of expensive calls before, I've significantly reduced
that.

Clipping partially off-screen images is now handled entirely by the
renderer, rather than while preparing the placement, and as such the
grid position passed to the image shader is now signed.
2025-05-15 11:41:12 -06:00
Leah Amelia Chen
d6dea79bde gtk: add option to always display the tab bar
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no
more tabs left (we probably already handle it somewhere else).
2025-05-15 19:05:46 +02:00
Aaron Ruan
f343e1ba46 Fix comma typo 2025-05-16 00:40:25 +08:00
Leah Amelia Chen
cc65dfc90e gtk(command_palette): focus fixes 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
2800e0c99b gtk(command_palette): address feedback related to selections
See #7173, #7175
2025-05-15 18:11:19 +02:00
Leah Amelia Chen
7293d91f10 translations(zh_CN): update 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
91f811bfbf translations: update 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
e97dfc2e19 gtk(command_palette): filter out certain actions 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
3b013b1174 gtk: add command palette to titlebar menu 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
048e4acb2c gtk: implement command palette 2025-05-15 18:11:19 +02:00
Aaron Ruan
f6d56f4f03 Handle check_for_updates as unimplemented action 2025-05-15 23:26:47 +08:00
Jeffrey C. Ollie
9ff43cd345 gtk: implement custom audio bell (#5326)
Fixes #2710 

Adds support for custom audio bell notifications.
2025-05-15 10:09:39 -05:00
Aaron Ruan
7ccc181332 macos: add "Check for Updates" action, menu item & key-binding support 2025-05-15 13:34:44 +08:00
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
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
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
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