9140 Commits

Author SHA1 Message Date
Nico Weber
6a2597a6d6 macos: Make "Settings…" menu item open config file in Application Support
...unless ~/.config/ghostty/config already exists, then that is opened.
(Or whatever $XDG_CONFIG_HOME points to.)

If both files exists, ghostty reads first the one in ~/.config/ghostty/config
and then the one in Application Support, and merges the settings. In that case,
the menu item opens the file at ~/.config.

Fixes #2890.
2024-12-22 08:45:45 -05:00
Troels Thomsen
0611ca414f Divide red component of unfocused split fill color 2024-12-22 09:59:15 +01:00
deftdawg
a469191311 Merge branch 'ghostty-org:main' into alt-keybindings-copy-and-paste 2024-12-22 02:06:54 -05:00
Mitchell Hashimoto
b92fb2d901 macOS: Customize Ghostty Icon (#3063)
This is some last minute flare to get into the 1.0 release. 😄 

This introduces some new configurations to let you customize the macOS
app icon at runtime. The runtime icon only applies to certain areas such
as the dock, cmd-tab, etc. It does not change the icon in Finder or on
disk since Apple requires those icons are bundled as files with the
signed app bundle (i.e. you can't change it later without resigning).

I still think this introduces a lot of fun into the macOS app. 😄 

I'm still finalizing the exact customization options that will exist for
the icon, so I documented this option as experimental. I'm feeling
pretty good about what's there but I may add other options in the
future.

## Demo

### Beige Yellow

```
macos-icon = custom-style
macos-icon-frame = beige
macos-icon-ghost-color = yellow
macos-icon-screen-color = dark goldenrod,dark khaki
```

![CleanShot 2024-12-21 at 19 55
49@2x](https://github.com/user-attachments/assets/50d782ae-f30c-4a14-afc9-150b98b1659c)

### Laker Nation

```
macos-icon = custom-style
macos-icon-ghost-color = yellow
macos-icon-screen-color = purple,maroon
```

![CleanShot 2024-12-21 at 19 56
26@2x](https://github.com/user-attachments/assets/f82c901c-27a2-4fdb-8c46-9d1a5d8e5f39)
2024-12-21 20:07:42 -08:00
Mitchell Hashimoto
4681719e43 config: mark as experimental 2024-12-21 19:57:50 -08:00
Mitchell Hashimoto
1f468202d4 macos: add macos-icon-frame and some custom frame styles 2024-12-21 19:48:24 -08:00
Mitchell Hashimoto
bcced34726 config: additional macos-icon docs 2024-12-21 19:31:31 -08:00
Mitchell Hashimoto
e4b6b89951 config: ensure formatting can only return OOM 2024-12-21 19:31:31 -08:00
Mitchell Hashimoto
abf713feec macos: support the macos-icon configurations 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
29929a473d config: macos-icon configurations 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
298d6194f4 config: change color to a defined C struct for libghostty 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
adba2036e3 macos: custom app icon goes into About window 2024-12-21 19:31:30 -08:00
Mitchell Hashimoto
c4bec781b0 macos: colorized Ghostty icon begins! 2024-12-21 19:31:30 -08:00
Qwerasd
077dad11b4 font: add cursor-height metric, and adjust- config for it. 2024-12-21 20:15:53 -05:00
Mitchell Hashimoto
e97ebc5f7d bash: move functions and variables out of global scope (#3060)
Leave only `_ghostty` as a bash global.

I agree to re-license my commits to MIT
2024-12-21 17:11:10 -08:00
Mitchell Hashimoto
4524a16522 Update iTerm2 colorschemes (#3061)
Upstream revision:
d6c42066b3
2024-12-21 17:08:41 -08:00
mitchellh
7da6af85e1 deps: Update iTerm2 color schemes 2024-12-22 01:01:15 +00:00
Anund
e8d79ed035 bash: move functions and variables out of global scope 2024-12-22 11:33:41 +11:00
Damien MEHALA
196af6f2ca config: quick terminal auto hide
Introduce a setting allowing to customize the behavior of the quick terminal
when it loses focus. By default, the quick terminal will automatically hide.
However, you can now configure it to remain open by setting
`quick-terminal-autohide: false`.

Resolves #2558
2024-12-22 01:08:47 +01:00
Mitchell Hashimoto
dd6460bc77 update README 2024-12-21 13:07:35 -08:00
Mitchell Hashimoto
f2d4170322 update README for release 2024-12-21 13:05:13 -08:00
Mitchell Hashimoto
a74b555c42 bash: standardize on shorthand escape sequences (#3055)
We used a mix of shorthand and octal representations when printing these
control characters. Standardize on the shorter, more readable shorthand
notation because that's what we use in the other shell integration
scripts.
2024-12-21 12:02:23 -08:00
Jon Parise
76cd6b8b2e bash: standardize on shorthand escape sequences
We used a mix of shorthand and octal representations when printing these
control characters. Standardize on the shorter, more readable shorthand
notation because that's what we use in the other shell integration
scripts.
2024-12-21 10:19:58 -05:00
Mitchell Hashimoto
fc297da834 surface: don't early return when clearing hyperlinks (#3033)
When outside the viewport, other actions such as scrolling might be
happening, and doing an early return when clearing hyperlinks prevents
scrolling upwards.

We reposition the check, and do not early return so we can process
scrolling when it happens.

This fixes #2645, restoring the ability to scroll upwards while
retaining the behavior of hyperlinks when outside the viewport.

(and, yes I still permit my commits to be relicensed to MIT)

## Before
[Screen Recording 2024-12-21 at
01.36.02.webm](https://github.com/user-attachments/assets/bf144455-ff26-4d4e-9eff-c3d632c02c17)

## After
[Screen Recording 2024-12-21 at
01.36.44.webm](https://github.com/user-attachments/assets/308a795f-971d-4807-b4ba-91bd3685c185)
2024-12-21 07:18:31 -08:00
Mitchell Hashimoto
457bedc540 Bash complex completions (#3044)
Given https://github.com/ghostty-org/ghostty/discussions/2994 revert
f1728f594a.
Add documentation to help point people towards the discussion and needed
changes to handle `COMP_WORDBREAKS` not including expected characters.

We know macOS and nixos defaults to including `=` so explicit handling
to change behaviour should only be required if it turns out some
systematically used tool brings in a completion function that changes
`COMP_WORDBREAKS` away from the default. (something they should not be
doing)

If necessary I can create a issue to track handling unexpected word
breaks usage. This change improves the current completions.

I agree to re-license my commits to MIT
2024-12-21 07:10:08 -08:00
Mitchell Hashimoto
75a45f5692 config: blank title docs 2024-12-21 07:09:35 -08:00
Mitchell Hashimoto
05fd5e0cfd ci: release workflows build a dmg for macOS (#3047)
We've used a zip for the duration of the private beta but macOS users
expect a dmg. This commit changes both of our release workflows to begin
building a dmg instead of a zip.

![CleanShot 2024-12-20 at 21 26
53@2x](https://github.com/user-attachments/assets/2873854d-7849-4c53-9b58-e636ef8e2899)
2024-12-20 21:28:23 -08:00
Mitchell Hashimoto
555163cb1b ci: release workflows build a dmg for macOS
We've used a zip for the duration of the private beta but macOS users
expect a dmg. This commit changes both of our release workflows to begin
building a dmg instead of a zip.
2024-12-20 21:26:33 -08:00
Mitchell Hashimoto
896e975593 CI: Add --prefix option to git archive (#3043)
Without a prefix option, the result of extracting the archive is the
repository being laid out flat
which requires an extra step of making a directory and changing into it.
` tar -xvf "${SOURCE_TAR}" -C "$BUILD_NAME"`, Change into the directory
first, then perform extraction.
Running a plain `tar -xvf ghostty-source.tar.gz` on results in the
following structures
```
 .
├── build.zig
├── build.zig.zon
├── com.mitchellh.ghostty.yml
├── conformance
├── CONTRIBUTING.md
├── dist
├── example
├── flake.lock
├── flake.nix
├── ghostty-source.tar.gz
├── images
├── include
├── macos
├── Makefile
├── nix
├── PACKAGING.md
├── pkg
├── README.md
├── README_TESTERS.md
├── shell.nix
├── src
├── test
├── TODO.md
├── typos.toml
└── vendor
```
With a prefix, extracted contents are kept under a top-level directory
```
.
├── ghostty-source
│   ├── build.zig
│   ├── build.zig.zon
│   ├── com.mitchellh.ghostty.yml
│   ├── conformance
│   ├── CONTRIBUTING.md
│   ├── dist
│   ├── example
│   ├── flake.lock
│   ├── flake.nix
│   ├── images
│   ├── include
│   ├── macos
│   ├── Makefile
│   ├── nix
│   ├── PACKAGING.md
│   ├── pkg
│   ├── README.md
│   ├── README_TESTERS.md
│   ├── shell.nix
│   ├── src
│   ├── test
│   ├── TODO.md
│   ├── typos.toml
│   └── vendor
└── ghostty-source.tar.gz
```
This would be a breaking change for scripts depending on the current
archive format but it I think is easier to work with and a change that
should be made before 1.0.
2024-12-20 19:39:03 -08:00
Anund
9c96a80f8b bash: document COMP_WORDBREAKS interaction 2024-12-21 14:09:18 +11:00
Anund
3f94c84c80 Revert "bash: remove quoted completions while sorting possible portability issue"
This reverts commit f1728f594a681941b85a8d2fa8a136d625d9b633.
2024-12-21 13:43:41 +11:00
Anthony
c6796ce33e Add --prefix option to git archive to extract with a top-level directory 2024-12-21 13:27:59 +11:00
Mitchell Hashimoto
d3de22ce28 ci: generate a correct sparkle version string for tagged releases 2024-12-20 14:42:19 -08:00
Mitchell Hashimoto
663205b509 Make Ghostty release channel aware (#3037)
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:27:34 -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
Mitchell Hashimoto
a34c8ba7ce ci: release tag workflow (#3036)
This adds a new workflow for building and releasing _tagged versions_ of
Ghostty. The workflow is triggered automatically by new tags in the
format of `vX.Y.Z` but can also be manually triggered by running the
workflow from the GitHub Actions UI.

Release artifacts are uploaded to a completely separate R2 bucket with
its own access policy, retention, API keys, and so on.

There is currently no way to switch between "channels" in the macOS app.
I will follow up with a separate commit to add this feature.
2024-12-20 13:36:18 -08:00
Mitchell Hashimoto
0abd4ea8a2 ci: release tag workflow
This adds a new workflow for building and releasing _tagged versions_
of Ghostty. The workflow is triggered automatically by new tags in the
format of `vX.Y.Z` but can also be manually triggered by running the
workflow from the GitHub Actions UI.

Release artifacts are uploaded to a completely separate R2 bucket
with its own access policy, retention, API keys, and so on.

There is currently no way to switch between "channels" in the macOS
app. I will follow up with a separate commit to add this feature.
2024-12-20 13:02:05 -08:00
moni
819b7e066d surface: don't early return when clearing hyperlinks
When outside the viewport, other actions such as scrolling might be happening, and doing an early return when clearing hyperlinks prevents scrolling upwards.

We do not early return so we can process scrolling when it happens.
2024-12-21 04:24:00 +08:00
Mitchell Hashimoto
ef56fe8796 WIP CI Release Script (#3034) 2024-12-20 09:58:15 -08:00
Mitchell Hashimoto
486a5a4875 ci: tagged release workflow 2024-12-20 09:52:22 -08:00
Mitchell Hashimoto
330bbd0502 macos: add "Docs" button to the About window 2024-12-20 09:11:04 -08:00
Mitchell Hashimoto
2b352c0349 build: change object storage domain to ghostty.org (#3031)
DNS and TLS are up to date so this should all work. I want to start
rolling this out now so I can phase out the `.dev` before the 1.0
release.
2024-12-20 09:02:39 -08:00
Mitchell Hashimoto
c74966e07e build: change object story domain to ghostty.org 2024-12-20 08:58:46 -08:00
Mitchell Hashimoto
5bb05996eb avoid asserting working directory is absolute (#3028)
`std.fs.accessAbsolute` asserts if the user proposed path is absolute,
which we are seemingly passing as-is with no validating that it is.

When running with safety checks on, passing non-absolute path to
--working-directory will make ghostty crash.

I changed it to use `Dir.access`, which is just `accessAbsolute` without
the check.

This has the side effect of also allowing relative working directory.
2024-12-20 08:25:51 -08:00
Mitchell Hashimoto
0f588d72c7 Change to F3 legacy encoding with modifiers (#3019)
The [fixterms](http://www.leonerd.org.uk/hacks/fixterms/) "Really
Special Keypresses" section suggests using CSI 1 ; Ps R for F3, but this
is also a valid cursor position report. The intention was to make
back-compatible changes, so this is fairly considered a specification
bug.

This changes F3 in legacy mode to send CSI 13 ; Ps ~ instead, this is a
variant listed in fixterms, is what kitty protocol uses, and lacks the
problematic overlap with cursor positions.

The KeyEncoder.zig unit test has been changed accordingly, and all tests
pass on my machine.
2024-12-20 08:25:30 -08:00
Khang Nguyen Duy
239056c90f avoid asserting working directory is absolute
`std.fs.accessAbsolute` asserts if the user proposed path is absolute,
which we are seemingly passing as-is with no validating that it is.

When running with safety checks on, passing non-absolute path to
--working-directory will make ghostty crash.

I changed it to use `Dir.access`, which is just `accessAbsolute` without
the check.

This has the side effect of also allowing relative working directory.
2024-12-20 22:41:28 +07:00
Mitchell Hashimoto
b8ffee7acb webgen: update config to support callouts, emit keybind actions (#3023) 2024-12-19 19:27:55 -08:00
Mitchell Hashimoto
270d454c4e webgen: update config to support callouts, emit keybind actions 2024-12-19 17:15:39 -08:00
Sam Atman
8cadc7030c Change to F3 legacy encoding with modifiers
The [fixterms](http://www.leonerd.org.uk/hacks/fixterms/) "Really
Special Keypresses" section suggests using CSI 1 ; Ps R for F3, but this
is also a valid cursor position report.  The intention was to make back-
compatible changes, so this is fairly considered a specification bug.

This changes F3 in legacy mode to send CSI 13 ; Ps ~ instead, this is a
variant listed in fixterms, is what kitty protocol uses, and lacks the
problematic overlap with cursor positions.

The KeyEncoder.zig unit test has been changed accordingly, and all tests
pass on my machine.
2024-12-19 17:05:29 -05:00
Mitchell Hashimoto
d6e7685816 Docfix: correct comment for modifyOtherKeys sequence (#3018)
The comment in `function_keys.zig` was missing the `>` character for the
sequence. I've confirmed that this was just the comment, Ghostty treats
the original as an SGR sequence, which it is. Conversely, it does treat
`\x1b[>4;2m` as activating modifyOtherKeys.
2024-12-19 14:02:56 -08:00