Commit Graph

8166 Commits

Author SHA1 Message Date
Justy Null
45aceace72 fix: disable renderer background when macOS effects are enabled 2025-12-15 10:12:11 -08:00
Justy Null
d40af61960 refactor: migrate background glass effect to new macos-background-style config 2025-12-15 10:10:51 -08:00
Justy Null
a02364cbef feat: add liquid glass background effect support 2025-12-15 10:10:51 -08:00
Mitchell Hashimoto
47462ccc95 clean up some blurring code 2025-12-15 09:40:10 -08:00
James Baumgarten
b15f16995c Fix i3 window border disappearing after fullscreen toggle
When toggling a Ghostty window between fullscreen and windowed mode in
the i3 window manager, window borders would disappear and not return.

Root cause was that syncAppearance() was updating X11 properties on
every call during window transitions, even when values hadn't changed.
These redundant property updates interfered with i3's border management.

The fix adds caching to syncBlur() and syncDecorations() to only update
X11 properties when values actually change, eliminating unnecessary
property changes during fullscreen transitions.
2025-12-15 09:33:00 -08:00
Mitchell Hashimoto
195c1561fa refactor(build): simplify dependency detection logic (#9914)
Closes #9894

**Problem**: Since #9850, a local build incorrectly identifies itself as
1.3.0 stable (in lieu of tip w/ commit info).

**Bug**: `@import("root")` in `Config.zig` resolves to the compilation
root (`main.zig`), not `build.zig` where the marker was defined. So
`@hasDecl` always returned false (i.e. all builds treated as
dependencies).

**Solution**: More or less @rockorager's original approach from #9850.

> _Use `@src().file` to get ghostty's source directory and compare it
with `b.build_root`. When they differ, ghostty is a dependency and we
skip git detection._

However, there is a potential edge case where if a downstream project
also has a `src/build/Config.zig` this will fail silently - seems
unlikely, but worth noting.

**Testing**:

```
$ zig build -p $HOME/.local -Doptimize=ReleaseFast
$ ghostty --version
Ghostty 1.3.0-main+a0a915a06

Version
  - version: 1.3.0-main+a0a915a06
  - channel: tip
```

---

> **AI Disclosure**: I used Claude Code to review and identify edge
cases.
2025-12-15 08:46:02 -08:00
kadekillary
a0a915a06f refactor(build): simplify dependency detection logic
- Removes unnecessary marker constant from build.zig that existed
  solely to signal build root status
- Uses filesystem check (@src().file access) instead of compile-time
  declaration lookup to detect when ghostty is a dependency
- Same behavior with less indirection: file resolves from build root
  only when ghostty is the main project
2025-12-15 06:31:54 -06:00
Jon Parise
b0c053cfb7 zsh: document unsupported system-level ZDOTDIR
We rely on temporarily setting ZDOTDIR to our `zsh` resource directory
to implement automatic shell integration. Setting ZDOTDIR in a system
file like /etc/zshenv overrides our ZDOTDIR value, preventing our shell
integration from being loaded.

The only way to prevent /etc/zshenv from being run is via the --no-rcs
flag. (The --no-globalrcs only applies to system-level files _after_
/etc/zshenv is loaded.) Unfortunately, there doesn't appear to be a way
to run a "bootstrap" script (to reimplement the Zsh startup sequence
manually, similar to how our bash integration works) and then enter an
interactive shell session.

https://zsh.sourceforge.io/Doc/Release/Files.html

Given all of the above, document this as an unsupported configuration
for automatic shell integration and point affected users at our manual
shell integration option.
2025-12-14 20:24:41 -05:00
Mitchell Hashimoto
1fdc0c0b9f terminal: CSI S compatiblity improvements
Fixes #9905

This fixes a major compatibility issues with the CSI S sequence:

When our top margin is at the top (row 0) without left/right
margins, we should be creating scrollback. Previously, we were
only deleting.
2025-12-14 14:36:42 -08:00
Mitchell Hashimoto
dfb94cd55d apprt/gtk: clean up gotoWindow 2025-12-13 14:23:53 -08:00
Max Bretschneider
bb246b2e0c Added null handling for findCustom 2025-12-13 13:45:45 -08:00
Max Bretschneider
7e0dc09873 Just using decl literals 2025-12-13 13:45:45 -08:00
Max Bretschneider
6230d134e1 Type-safe rework 2025-12-13 13:45:45 -08:00
Max Bretschneider
6b8a7e1dd1 Replaced direction switch, direclty handling next and previous now 2025-12-13 13:45:45 -08:00
Max Bretschneider
4f02e6c096 Wrong action typo fix 2025-12-13 13:45:45 -08:00
Max Bretschneider
afbcfa9e3d Added GOTO_WINDOW to actions 2025-12-13 13:45:44 -08:00
Max Bretschneider
55ae4430b9 Formatting 2025-12-13 13:45:44 -08:00
Max Bretschneider
3000136e61 Changed switching previous/next to have no duplication 2025-12-13 13:45:44 -08:00
Max Bretschneider
1c1ef99fb1 Window switching initial 2025-12-13 13:45:44 -08:00
Mitchell Hashimoto
1805a9cb87 fix: explicitly allow preservation for TERMINFO in shell-integration (#9891)
Due to security issues, `sudo` implementations may not preserve
environment variables unless appended with `--preserve-env=list`.

Problem context: https://github.com/ghostty-org/ghostty/discussions/9861
2025-12-13 08:41:28 -08:00
Mitchell Hashimoto
c5d6b951e9 input: shift+backspace in Kitty with only disambiguate should do CSIu
Fixes #9868 (shift+backspace part only)
2025-12-13 07:18:22 -08:00
definfo
4a04efaff1 fix: explicitly allow preservation for TERMINFO in shell-integration
Due to security issues, `sudo` implementations may not preserve
environment variables unless appended with `--preserve-env=list`.

Signed-off-by: definfo <hjsdbb1@gmail.com>
2025-12-13 16:55:41 +08:00
Mitchell Hashimoto
7a1ff7779b feat: add readonly surface mode (#9130)
Tried my hand at #8432

Currently lacking tests and some sort of visual indicator that the
surface is locked.

Also, not entirely sure if I needed to touch `application.zig`.

Found what needed changing with help from Copilot (and added Docs w/
Copilot), but wrote most of the code myself.
2025-12-12 14:16:39 -08:00
Mitchell Hashimoto
182cb35bae core: remove readonly check 2025-12-12 14:15:43 -08:00
Mitchell Hashimoto
dc7bc3014e add apprt action to notify apprt of surface readonly state 2025-12-12 13:13:54 -08:00
Mitchell Hashimoto
0bf3642939 core: manage read-only through queueIo 2025-12-12 13:08:03 -08:00
Michael Hazan
6dd9a74e6e fix(docs): window-decoration is now none instead of false 2025-12-12 22:56:06 +02:00
Mitchell Hashimoto
29fdb541d5 make all IO message queueing go through queueIo so we can intercept 2025-12-12 12:00:28 -08:00
Michael Bommarito
2d9c83dbb7 fix: bash shell integration use-after-free bug
The ShellCommandBuilder uses a stackFallback allocator, which means
toOwnedSlice() may return memory allocated on the stack. When setupBash()
returns, this stack memory becomes invalid, causing a use-after-free.

This manifested as garbage data in the shell command string, often
appearing as errors like "/bin/sh: 1: ically: not found" (where "ically"
was part of nearby memory, likely from the comment "automatically").

The fix copies the command string to the arena allocator before returning,
ensuring the memory remains valid for the lifetime of the command.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-12 13:36:36 -05:00
Mitchell Hashimoto
b58ac983cf docs changes 2025-12-12 07:29:46 -08:00
Matthew Hrehirchuk
6369aaa93e Merge branch 'main' of github.com:ghostty-org/ghostty into feat/read-only 2025-12-12 07:24:48 -08:00
Matthew Hrehirchuk
547bcd261d fix: removed apprt action for toggle_readonly 2025-12-12 07:24:22 -08:00
Matthew Hrehirchuk
12bb2f3f47 feat: add readonly surface mode 2025-12-12 07:24:22 -08:00
Mitchell Hashimoto
dd06d8a13b os/shell: introduce ShellCommandBuilder (#9881)
This builder is an efficient way to construct space-separated shell
command strings.

We use it in setupBash to avoid using an intermediate array of arguments
to construct our bash command line.
2025-12-12 07:09:58 -08:00
Jon Parise
04fecd7c07 os/shell: introduce ShellCommandBuilder
This builder is an efficient way to construct space-separated shell
command strings.

We use it in setupBash to avoid using an intermediate array of arguments
to construct our bash command line.
2025-12-12 08:59:44 -05:00
Mitchell Hashimoto
cba82e976c macOS: Change Tab Title (#9879)
This adds the ability to change a _tab_ title. The previous
functionality was tied to a specific _surface_. A tab title will stick
to the current tab regardless of active splits and so on.

This follows the nomenclature that macOS terminal app does which is
"title vs terminal title" (although we explicitly use "tab" in various
places, I may remove that in the future).

**This is macOS only. GTK is tracked here: #9880**. I did macOS only
because thats the machine I'm on. It'll be trivial to add this to GTK,
too.

## Demo


https://github.com/user-attachments/assets/d9446785-d919-4212-8553-db50c56c8c2f

(The option is also in the main menu, the context menu, and the command
palette)

## AI Disclosure

This PR was done fully with Amp, I didn't write a single line of code at
the time of writing this PR description. I reviewed everything though
and fully understand it all. Its a mimic more or less of the prompt
surface title work (although we did unify some stuff like the apprt
action).
2025-12-11 16:53:50 -08:00
Mitchell Hashimoto
6105344c31 macos: add change tab title to right click menu 2025-12-11 16:30:06 -08:00
Mitchell Hashimoto
65cf124e2c core: change apprt action to enum value instead of a new one 2025-12-11 16:09:45 -08:00
Mitchell Hashimoto
32033c9e1a core: prompt_tab_title binding and apprt action 2025-12-11 16:03:19 -08:00
Jon Parise
c0deaaba4e bash: use a shell command for shell integration
Prior to #7044, on macOS, our shell-integrated command line would be
executed under exec -l, which causes bash to be started as a login
shell. This matches the macOS platform norms.

The change to direct command execution meant that we'd skip that path,
and bash would start as a normal interactive (non-login) shell on macOS.
We fixed this in #7253 by adding `--login` to the `bash` direct command
on macOS.

This avoided some of the overhead of starting an extra process just to
get a login shell, but it unfortunately doesn't quite match the bash
environment we get when shell integration isn't enabled (namely, $0
doesn't get the login-shell-identifying "-" prefix).

Instead, this change implements the approach proposed in #7254, which
switches the bash shell integration path to use a .shell command, giving
us the same execution environment as the non-shell-integrated command.
2025-12-11 17:02:14 -05:00
Devzeth
b224b69054 fix(terminal): increase grapheme_bytes instead of hyperlink_bytes during reflow
When reflowing content with many graphemes, the code incorrectly increased hyperlink_bytes capacity
instead of grapheme_bytes, causing GraphemeMapOutOfMemory errors.
2025-12-11 07:03:12 -08:00
Mitchell Hashimoto
86503045e9 fix: prevent integer overflow in hash_map layoutForCapacity (#9871)
Closes #9862
2025-12-11 06:57:23 -08:00
benodiwal
0d8c193bda fix(terminal): prevent integer overflow in hash_map layoutForCapacity
Co-Authored-By: Sachin <sachinbeniwal0101@gmail.com>
2025-12-11 16:43:16 +05:30
Mitchell Hashimoto
3352d5f081 Fix up close right description 2025-12-10 20:57:36 -08:00
Mitchell Hashimoto
cca10f3ca8 Revert GTK UI changes, apple-sdk build stuff 2025-12-10 20:20:37 -08:00
George Papadakis
625d7274bf Add close tabs on the right action 2025-12-10 20:14:27 -08:00
Mitchell Hashimoto
7642b8bec4 build: highway system integration should default to false 2025-12-10 13:13:38 -08:00
Mitchell Hashimoto
143748a8d3 Add system integration for highway (#9642) 2025-12-10 13:00:46 -08:00
Mitchell Hashimoto
af05397219 synthetic: make bytes generation more flexible (#9204) 2025-12-10 12:59:46 -08:00
Mitchell Hashimoto
581ed72efc gtk: support GTK 4.20 media queries in runtime & custom css (#9520) 2025-12-10 12:55:25 -08:00