9036 Commits

Author SHA1 Message Date
Mitchell Hashimoto
bc5cbf3e87 kittygfx: Ensure temporary files are named per spec (#4451)
Temporary files used with Kitty graphics must have
"tty-graphics-protocol" somewhere in their full path.


https://sw.kovidgoyal.net/kitty/graphics-protocol/#the-transmission-medium
2025-01-02 19:13:19 -08:00
Bryan Lee
ac524b6c34 Correct typos and update typos.toml 2025-01-03 09:55:21 +08:00
David Leadbeater
4cb2fd4f79 Add negative test for temporary filename and fix other tests 2025-01-03 12:09:49 +11:00
Mitchell Hashimoto
a10b45fb1f core: detect what desktop environment the user is using (#4343) 2025-01-02 16:44:16 -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
c89df01e13 core: prohibit checking for the desktop environment on linux during comptime 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
Mitchell Hashimoto
cde8b7e810 chore: fix typos (#4407)
Fixes:

- te -> the
- require you restart -> require you to restart
- neovim -> Neovim
2025-01-02 16:15:42 -08:00
David Leadbeater
c9dfcd2781 kittygfx: Ensure temporary files are named per spec
Temporary files used with Kitty graphics must have
"tty-graphics-protocol" somewhere in their full path.

https://sw.kovidgoyal.net/kitty/graphics-protocol/#the-transmission-medium
2025-01-03 11:15:03 +11:00
Mitchell Hashimoto
7e1b7bb8b3 performable: prefix (#4345)
closes #4328
closes #3970

makes this possible now
```
keybind = performable:ctrl+c=copy_to_clipboard # copy if theres a selection else send sigint
keybind = ctrl+v=paste_from_clipboard
```
2025-01-02 16:11:24 -08:00
Mitchell Hashimoto
bcd4b3a680 config: improve adw-toast docs 2025-01-02 16:07:58 -08:00
Mitchell Hashimoto
d42e67bdad gtk: fix non-notebook separator colors (#4421)
Before: 
![Screenshot From 2025-01-02
12-25-55](https://github.com/user-attachments/assets/62c3f15b-e717-499b-963f-c72ec8988f25)
After:
![Screenshot From 2025-01-02
12-28-02](https://github.com/user-attachments/assets/9e04b249-2414-4cae-8ea2-94c86bba5be6)
2025-01-02 16:04:54 -08:00
Mitchell Hashimoto
e6399c947a update our default bindings that are performable 2025-01-02 15:54:09 -08:00
Jeffrey C. Ollie
a0de1be65f gtk: fix non-notebook separator colors 2025-01-02 17:49:15 -06:00
Mitchell Hashimoto
b65c26966a macos: fix window borders on dark mode (#4308)
After updating to 1.0.1 I noticed something different in the terminal,
which turned out being the window borders - it appeared as if Ghostty
was using light-mode style borders (dark/black outline with a thin light
stroke at the top) instead of the entire light outline from before:

| 1.0.0 | 1.0.1 |
| - | - |
| <img width="308" alt="Screenshot 2025-01-01 at 2 28 12 PM"
src="https://github.com/user-attachments/assets/d8bc5bdd-c3b2-401c-a8ed-9da0b768cb3d"
/> | <img width="308" alt="Screenshot 2025-01-01 at 2 29 07 PM"
src="https://github.com/user-attachments/assets/fd710bed-1756-4f66-8402-bfbdd25218ab"
/> |

After digging a bit, I found #3834, which fixes fullscreen background
colors through alpha channels by appending a `withAlphaComponent(0.0)`
to `backgroundColor` - for reasons I may be entirely unaware of (since
I'm not a Swift developer), this seems to cause the dark-mode border
style to go away.

Some lines above that, I noticed the `.clear` callout from line 266,
which talks about matching Terminal.app's styles, and it _also_ has a
`withAlphaComponent` but set to `0.001` - if I understand correctly, and
the fix from #3834 works by setting the alpha component to a
_practically_ zero value, then I thought perhaps a really small number
like `0.001` could do the trick as well. This ended up working and
bringing back the right borders again.

Not sure again if this may make a difference anywhere else in the app or
bring any undesired behavior, but if anyone who is well-versed in Swift
would like chime in with more details or perhaps a better approach, I'd
greatly appreciate it!
2025-01-02 15:41:57 -08:00
Mitchell Hashimoto
95b73f197f Add docs for performable 2025-01-02 15:41:01 -08:00
Mitchell Hashimoto
89e0e7e69c support different base for palette keys in config (#4298)
motivated by the desire to align config lines

https://ziglang.org/documentation/master/std/#std.fmt.parseInt

unaligned

```ini
palette = 0=#333333

palette = 1=#FF9999
palette = 2=#99FF99
palette = 4=#9999FF

palette = 3=#FFFF33
palette = 5=#FF33FF
palette = 6=#33FFFF

palette = 7=#CCCCCC
palette = 8=#666666

palette = 9=#FF66CC
palette = 10=#CCFF66
palette = 12=#66CCFF

palette = 11=#FFCC66
palette = 13=#CC66FF
palette = 14=#66FFCC

palette = 15=#FFFFFF
```

expecting

```ini
palette = 0x0=#333

palette = 0x1=#F99
palette = 0x2=#9F9
palette = 0x4=#99F

palette = 0x3=#FF3
palette = 0x5=#F3F
palette = 0x6=#3FF

palette = 0x7=#CCC
palette = 0x8=#666

palette = 0x9=#F6C
palette = 0xA=#CF6
palette = 0xC=#6CF

palette = 0xB=#FC6
palette = 0xD=#C6F
palette = 0xE=#6FC

palette = 0xF=#FFF
```
2025-01-02 15:37:20 -08:00
Gabriel Moreno
82695edaff macos: fix window borders on dark mode 2025-01-02 15:27:01 -08:00
Damien Mehala
8d7ed3e0fc feat: parse ConEmu OSC9;2 2025-01-03 00:26:06 +01:00
Mitchell Hashimoto
405fe377d2 wuffs: update, add jpeg decoding, add simple tests (#4250)
1. Update wuffs to v0.4.0-alpha.9
2. Add JPEG decoding
3. Add basic unit tests for image decoding
4. Add CI jobs to run wuffs unit tests.
2025-01-02 15:24:28 -08:00
roshal
fe9bbec92e config: allow other base numbers for palette indexes 2025-01-02 15:21:57 -08:00
Mitchell Hashimoto
263146ebe2 core: if we change RLIMIT_NOFILE, reset it when executing commands (#4241)
Fixes #4232 .
2025-01-02 15:19:52 -08:00
Mitchell Hashimoto
8827b6e738 Partial fix for #1938, add GDK_DEBUG=gl-no-fractional (#4255)
GSK_RENDERER=opengl does not properly handle fractional scaling and thus
we need to set GDK_DEBUG=gl-no-fractional.

Potential fix for #1938
2025-01-02 15:17:25 -08:00
Mitchell Hashimoto
0ef24f3c75 ci: only test pkgs on Linux 2025-01-02 15:08:42 -08:00
Mitchell Hashimoto
8e47d0267b Move resource limits to a dedicated struct, restore before preexec 2025-01-02 15:05:10 -08:00
Damien Mehala
9d9fa60ece code review
- Default to 100 if the value can't be parsed as an integer or
  is missing entirely.
2025-01-02 23:57:53 +01:00
Mitchell Hashimoto
602e4eb606 Implement loading custom css in the GTK app (#4200)
Closes https://github.com/ghostty-org/ghostty/issues/4089
Gave it a shot and implemented the custom css loading.
My general idea is to use a provider for each stylesheet the user wants
to load and then when the config changes unload them and create new
providers.
A separate provider has to be used for each stylesheet the user wants to
load, since when the provider loads the css it clears all the previously
loaded styles, so in effect we cannot use one provider to load multiple
stylesheets, but maybe there is a better way to overcome this limitation
which I'm not seeing.
2025-01-02 14:34:28 -08:00
Mitchell Hashimoto
764a2365af don't build harfbuzz when system integration is enabled (#4205)
makes use of the system harfbuzz if system integration is enabled
otherwise it builds the library and uses it in the module

this has the added benefit that package maintainers don't have to ship a
separate copy of harfbuzz and worry about compatibility with the system
library

Some notes:
- the logic to build the library has been split into a separate function
- needed options are passed as an anonymous struct because its so
minimal that there really is not need for an explicit type
- unlike `Build.systemIntegrationOption`, `Build.option` cannot be
called mutiple times to declare it before its used

tests appear to run on my system both with and without system
integration
2025-01-02 14:33:12 -08:00
Mitchell Hashimoto
8c74b80704 config: Add the option toast_on_clipboard_copy (#4185)
Add a config option to enable/disable the toast shown on clipboard copy

Also suggested in
https://github.com/ghostty-org/ghostty/discussions/4165
2025-01-02 14:31:13 -08:00
Mitchell Hashimoto
509cf306f5 config: improve documentation for color configuration (#4184)
The documentation used to say e.g. "The format of the color is the same
as the `background` configuration; see that for more information.", yet
`background` left the format actually undocumented.

To avoid people having to jump around the docs to find out the supported
formats, the prose for the formats is repeated for each color.

I dug around a bit to find out that named colors from the default X11
map are also a supported format (`cursor-color = purple` works fine), so
that's now documented too.
2025-01-02 14:23:09 -08:00
Mitchell Hashimoto
fb8c83e07c config: change toast config to packed struct 2025-01-02 14:15:16 -08:00
Mitchell Hashimoto
d28024bb60 Clarify CLI vs. Keybind Actions documentation (#4116)
https://github.com/ghostty-org/ghostty/discussions/4107#discussioncomment-11699228

I was confused about not being able to run `ghostty +new_window` since I
hadn't read the docs closely enough to understand the distinction
between Keybind Actions and CLI Actions.

I think if the error messages I've modified here would have read this
way to begin with I would've had a better chance of discovering this
distinction on my own.

I did read the Contributing guidelines but I avoided opening an Issue
since the changes here are minimal enough that I felt it would just add
noise. If that's a mistake then I'm happy to close this out and return
to the original discussion and/or create a new Issue.
2025-01-02 14:10:23 -08:00
Yotam Gurfinkel
e6bb1a56eb config: Add the option toast_on_clipboard_copy
Add a config option to enable/disable the toast shown on clipboard copy
2025-01-02 14:09:29 -08:00
Mitchell Hashimoto
5293e8a819 Merge branch 'patch-1' 2025-01-02 14:06:41 -08:00
Mitchell Hashimoto
bed37ac844 update wording 2025-01-02 14:06:23 -08:00
Mitchell Hashimoto
e7354e7308 Update src/config/Config.zig
Co-authored-by: Aarni Koskela <akx@iki.fi>
2025-01-02 14:05:49 -08:00
Mitchell Hashimoto
18001c3251 font: allow non-boolean font feature settings (#4139)
\+ much more flexible syntax and lenient parser
\+ allows comma-separated list as a single config value

This allows, e.g. `cv01 = 2` to select the second variant of `cv01`.

Resolves #3128 

Parser could probably be a little smaller than it is- would be a lot
cleaner with the labeled switch continue pattern from Zig 0.14. Maybe
should've put it in its own file too...

I spent *much* too long trying to test this with `cv01` with
[monaspace](https://github.com/githubnext/monaspace) before realizing
that the README refers to v1.2 but the latest released version (and
hence the one I had installed) was v1.101 -- I installed the v1.2
version and tested with both CoreText and HarfBuzz and successfully set
`cv01 = 2` and got the expected result.

Feel free to make any stylistic changes you feel necessary before
merging.
2025-01-02 14:04:20 -08:00
Mitchell Hashimoto
3a01beb050 Don't steal focus on mouse events that are within 1 px (#3997)
Fixes #3229


Gets the desired behavior for #3229, I'm unsure if there is a nicer way
to omit the mouse motion events from the event controller
when the glarea is resized due to the splitting behavior. Thresholding
to 1px is required because just checking for equality results
in the focus still being stolen sometimes. This is kinda of a hack so a
nicer solution would be much appreciated!
2025-01-02 14:01:27 -08:00
Mitchell Hashimoto
fc545cd048 fix: handle intermediate bytes in CSI and ESC sequences (#4063)
This adds missing handling for CSI and ESC commands.

Fixes: https://github.com/ghostty-org/ghostty/issues/3122

Supersedes: #3132
2025-01-02 13:53:19 -08:00
Mitchell Hashimoto
f5f887efd9 fix: selected text remains after clear_screen action (#4040)
Fixes #3414
2025-01-02 13:50:09 -08:00
Mitchell Hashimoto
1a530cb96a core: add build option to disable sentry (#3934)
This disables compiling/linking Sentry automatically on platforms other
than macOS, which removes a potential blocker for getting Ghostty
running on *BSD or other systems.

This is also useful for the security paranoid that don't want any chance
that sensitive information could be captured in a crash dump.
2025-01-02 13:49:54 -08:00
Matt Rochford
6a4842f110 Don't steal focus on mouse events that are within 1 px 2025-01-02 13:46:15 -08:00
Mitchell Hashimoto
f60068eabd add option to strip build regardless of optimization (#3945)
adds the option "strip" which can be used to override the default strip
setting, which is based on the optimization mode.

Useful for a distro setting where you want a release build but still
keep symbols.

Also reuses the option for the shared and static library
2025-01-02 13:41:47 -08:00
Mitchell Hashimoto
7eb6b29d4c macos: make auto-update optional (#4436)
When unset, we use Sparkle's default behavior, which is based on the
user's preference stored in the standard user defaults.

The rest of the previous behavior is preserved:
- When SUEnableAutomaticChecks is explicitly false, auto-updates are
disabled.
- When 'auto-update' is set, use its value to set Sparkle's auto-update
behavior.

Fixes #4433
2025-01-02 13:38:15 -08:00
Mitchell Hashimoto
0d2a6c7346 gtk: refactor gtk & adw notebook implementations (#3578)
Put GTK and libadwaita notebook implementations into separate structs/
files for clarity.
2025-01-02 13:37:29 -08:00
Mitchell Hashimoto
898d988799 Set an initial start position (#3929)
Allow the ability to set an initial start position from the config. Adds
`window-initial-position-{x,y}` to the config as an optional i16 value
(see swift docs in [this
comment](https://github.com/ghostty-org/ghostty/pull/3929#discussion_r1899266607)
for the reasoning behind this if needed) and handles setting the
position when the initial window is created

Closes https://github.com/ghostty-org/ghostty/issues/3362
2025-01-02 13:35:13 -08:00
Mitchell Hashimoto
7a5ef3da2b remove sentry test for macOS, remove windows check 2025-01-02 13:34:23 -08:00
Jeffrey C. Ollie
cb8d30f938 core: add build option to disable sentry 2025-01-02 13:32:45 -08:00
Jeffrey C. Ollie
0778c67429 gtk: refactor gtk & adw notebook implementations
Put GTK and libadwaita notebook implementations into separate structs/
files for clarity.
2025-01-02 15:21:11 -06:00
Mitchell Hashimoto
29b96be84f tweaks to window position 2025-01-02 13:18:53 -08:00