10271 Commits

Author SHA1 Message Date
Danil Ovchinnikov
42913c7830 i18n: fixed the translation for Russian
Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-28 04:08:04 +03:00
Mitchell Hashimoto
7daabdddef ci: iTerm2 colorscheme update should update flatpak deps (#7214) 2025-04-27 07:50:18 -07:00
Mitchell Hashimoto
99db6b59be Add config color palette C bindings (#7195)
C bindings to expose the color palette to Swift for macOS. Returns the
full 256 colors from the current color scheme. After fetching the
palette with `ghostty_config_get`, you can access the desired color by
its index in the list.

### Usage

Here is one way to get the palette in Swift.

```swift
import GhosttyKit

private(set) var config: ghostty_config_t? = nil {
    didSet {
        // Free the old value whenever we change
        guard let old = oldValue else { return }
        ghostty_config_free(old)
    }
}

var paletteColors: [Color] {
    var paletteList: ghostty_config_palette_s = .init()
    let key = "palette"
    
    if (!ghostty_config_get(config, &paletteList, key, UInt(key.count))) {
        return []
    }
    
    var colors: [Color] = []
    let mirror = Mirror(reflecting: paletteList.colors)
    
    for (_, element) in mirror.children {
        if let color = element as? ghostty_config_color_s {
            colors.append(Color(
                red: Double(color.r) / 255,
                green: Double(color.g) / 255,
                blue: Double(color.b) / 255
            ))
        }
    }
    
    print("Palette Colors: ", colors)
    return colors
}
```
Result (GruvboxDarkHard theme)
![CleanShot 2025-04-25 at 14 21
39](https://github.com/user-attachments/assets/a282fd8d-3e5e-4281-819c-dff00b84318f)
2025-04-27 07:14:26 -07:00
Mitchell Hashimoto
f0339d5e5b ci: iTerm2 colorscheme update should update flatpak deps 2025-04-27 07:01:52 -07:00
Mitchell Hashimoto
c7b8fd1354 flatpak: update dependencies 2025-04-27 07:00:24 -07:00
Mitchell Hashimoto
17441de37f Update iTerm2 colorschemes (#7210)
Upstream revision:
5233095e44
2025-04-27 06:53:06 -07:00
Mitchell Hashimoto
d4acdf44a9 z2d 0.6.0 -> 0.6.1 for security fix (#7211)
version 0.6.0 of z2d has a security vulnerability and the author
suggests upgrading (randomly saw this in the zig discord)

https://github.com/vancluever/z2d/security/advisories/GHSA-mm4c-p35v-7hx3

I don't know enough about how ghostty uses to it to say if it could be
affected

also updates that Context no longer returns an error type this says it
was in the 0.6.0 changes which ghostty was already pinned to (it seems
like that the tag might have been updated or something im not sure) you
can see it listed as a change in 0.6.0 below
https://github.com/vancluever/z2d/blob/main/CHANGELOG.md

I'm not sure if any other changes are required I ran a `zig build` and
`zig build test` and things seem to be fine on my end

~~I'm not sure I updated the zon nix stuff correctly I just ran the
command in jcollie readme
`nix run github:jcollie/zon2nix#zon2nix -- --nix=build.zig.zon.nix
build.zig.zon`~~ looks like I should have just ran the script

ps: sorry for the direct ping mitchell (I thought this might be
important that you look at it)
2025-04-27 06:51:23 -07:00
rhodes-b
ba5c773f0f update flatpak packages 2025-04-27 00:05:10 -05:00
rhodes-b
b1561112d0 run the nix cache script 2025-04-27 00:03:00 -05:00
rhodes-b
bbbe81efc5 z2d context no longer has err return 2025-04-26 23:51:04 -05:00
rhodes-b
0c8339d2da update z2d to 0.6.1 2025-04-26 23:39:02 -05:00
Aaron Ruan
1ec3e331de Refactor toggleMaximize to use notifications 2025-04-27 08:48:06 +08:00
mitchellh
12f48419b6 deps: Update iTerm2 color schemes 2025-04-27 00:14:50 +00:00
Mitchell Hashimoto
38445dca2a feat: beautify macOS command palette (#7179)
Resolve 1. of #7173
<img width="1126" alt="image"
src="https://github.com/user-attachments/assets/8904b09f-42f6-4f26-a722-c92dad8e2933"
/>

Changes made:
1. Change shortcut from `String` to `[String]` so its easier to iterate
over it.
2. Overlay background color on top of an `ultraThinMaterial` for better
aesthetic.
3. Reorganize and beautify the spacings and paddings.
4. Unhide the scrollbar.
5. Reorder the modifier keys to Control, Option, Shift and then Command.
<https://leancrew.com/all-this/2017/11/modifier-key-order/>
6. Style shortcut keys to resemble macOS menu bar items, using
corresponding symbols and fixed-width for alignment.
2025-04-25 12:01:01 -07:00
Mitchell Hashimoto
2b4d89e11f macOS: scheme doesn't need to be state 2025-04-25 11:42:12 -07:00
Friedrich Stoltzfus
77f5fc34f1 Add config color palette C bindings
C bindings to expose the color palette to Swift for macOS.
2025-04-25 14:10:35 -04:00
Aaron Ruan
334093a9ea feat: implement toggleMaximize for macOS 2025-04-25 15:59:44 +08:00
Aaron Ruan
1acb1715c3 replace NSVisualEffectView with ultraThinMaterial plus a background color 2025-04-25 10:42:22 +08:00
Aaron Ruan
3827ce9e4c feat: beautify command palette 2025-04-24 12:46:38 +08:00
Mitchell Hashimoto
4e91d11a60 macOS: add descriptions for PgUp, PgDown, End, and Home keys (#7177)
Resolves #7174. The PgUp, PgDown, End, and Home keys were not being
assigned a description in the `KeyboardShortcut` extension.
2025-04-23 13:32:51 -07:00
Friedrich Stoltzfus
f58fba54a0 macOS: add descriptions for PgUp, PgDown, End, and Home keys
These keys were not being assigned a description in the KeyboardShortcut
extension. This caused problems for the macOS command pallete.
2025-04-23 16:05:51 -04:00
Mitchell Hashimoto
afd8d10b82 macOS: Command palette has no selection by default, selection wraps (#7175)
#7173

(1) The command palette no longer has any selection by default. If and
when we introduce most recently used commands, defaulting to that would
make sense. A selection only appears when the arrow keys are used or the
user starts typing.

(2) The selection with arrow keys now wraps, so if you press "down" on
the last option, it will wrap to the first option, and if you press "up"
on the first option, it will wrap to the last option. This matches both
VSCode and Zed.
2025-04-23 10:50:13 -07:00
Mitchell Hashimoto
9bfe4544bf macOS: Command palette has no selection by default, selection wraps
#7173

(1) The command palette no longer has any selection by default.
If and when we introduce most recently used commands, defaulting to that
would make sense. A selection only appears when the arrow keys are used
or the user starts typing.

(2) The selection with arrow keys now wraps, so if you press "down" on
the last option, it will wrap to the first option, and if you press "up"
on the first option, it will wrap to the last option. This matches both
VSCode and Zed.
2025-04-23 10:37:20 -07:00
Mitchell Hashimoto
f2c798d319 macOS: Command Pallete Improvements (#7171)
As discussed in #7165, this PR resolves two issues with the command
pallete on macOS.
1. The flashing of a command passing out of view was caused by the
`withAnimation` function. Removing this closure resolved this issue.
2. The current implementation kept the selected command anchored to the
middle of the pallete. However, most command pallates allow you to key
through the visible options, only scrolling when your selection hits the
boundary. I resolved this by removing the `anchor: .center` parameter
for the `scrollTo` command.
2025-04-23 08:35:33 -07:00
Jeffrey C. Ollie
75cc4b29fd gtk: require blueprint-compiler 0.16 for building
Changes:

1. Require `blueprint-compiler` 0.16.0 (or newer) for building from
   a git checkout. With #6822 distributions that can't meet that
   requirement can use generated source tarballs to build.
2. Remove all `.ui` files as they are unnecessary.
3. Simplify the `Builder` interface since raw `.ui` files are no
   longer used.
4. Removed build-time check of raw `.ui` files.
2025-04-23 10:35:10 -05:00
Mitchell Hashimoto
ba6ed1f3c5 snap: build from source tarball (#6831)
Eliminates the need for `blueprint-compiler`, which isn't quite new
enough on the snap builder.
2025-04-23 06:58:14 -07:00
Jeffrey C. Ollie
6bd9e35cd6 snap: build from source tarball 2025-04-23 08:10:01 -05:00
Friedrich Stoltzfus
b4b2b10328 macOS: command pallete scroll improvements
Removes the withAnimation closure which caused flashing when scrolling
up or down with arrow keys. Also removes the center anchor to behave
more like other command palletes (e.g., Zed, Raycast).
2025-04-22 16:12:09 -04:00
Mitchell Hashimoto
f5b5a36835 Fix flatpak packaging to a working state (#6678)
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
2025-04-22 12:19:55 -07:00
Mitchell Hashimoto
e6c2105a2b ci: fix up flatpak deps 2025-04-22 12:02:24 -07:00
Mitchell Hashimoto
946cf5a375 update flatpak build hash 2025-04-22 10:57:17 -07:00
Mitchell Hashimoto
d7256c71c4 ci: flatpak 2025-04-22 10:56:10 -07:00
Mitchell Hashimoto
3e81006eaa prettier 2025-04-22 10:56:09 -07:00
Leorize
7c1e68293e flatpak: use archive for gtk4-layer-shell 2025-04-22 10:56:09 -07:00
Leorize
0473b0c3f4 metainfo: update with extra data
* Added URLs to more resources
* Fixed developer ID
* Added device compatibility information
2025-04-22 10:56:09 -07:00
Leorize
9de1aadbab flatpak: add development variant
This variant is built in Debug mode and is given a different desktop
file so it could be installed side-by-side with regular Ghostty.
2025-04-22 10:56:09 -07:00
Leorize
3232cfe138 flatpak: keep debug info for ghostty itself
Flatpak will strip them out on its own into an extension package, useful
for debugging
2025-04-22 10:56:09 -07:00
Leorize
ebc169dbaf Fix flatpak packaging to a working state
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
2025-04-22 10:56:09 -07:00
Mitchell Hashimoto
17b0bf585d apprt/gtk: add menu to new tab button to create splits (#7137)
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
2025-04-22 09:07:10 -07:00
Mitchell Hashimoto
f36729de39 mark new strings as untranslated 2025-04-22 08:57:29 -07:00
Mitchell Hashimoto
ba67c506f2 ci: extract translation check to script so we can run standalone 2025-04-22 08:55:03 -07:00
Mitchell Hashimoto
74e1c47623 macOS: Command Palette (#7153)
This introduces a command palette (inspired by @pluiedev's work in
#5681, but not using it as a base) for macOS.

The command palette is available in the `View` menu and also bindable
via `toggle_command_palette`, default binding is `cmd+shift+p` to match
VSCode.

The commands in the command palette must map to a _bindable_ action,
though they may not have an associated keybinding. This means that any
new binding actions we add in the future can be represented here and
also makes it easy in the future to add configuration to add new custom
entries to the command palette. For this initial PR, the available
commands are hardcoded (`src/input/commands.zig`).

I've noticed in other programs (VSCode, Zed), the command palette
contains pretty much _all available actions_ even if they're basically
useless in the context of a command palette. For example, Zed has the
"toggle command palette" action in the command palette and it... does
nothing (it probably should hide the palette). I followed @pluiedev's
lead and made this subjective in this PR but I wonder if we should
actually force all binding actions to be available.

There are various other improvements I'd like to make but omitted from
this PR for the sake of limiting scope:

* Instead of an entry with no matches doing nothing, we can allow users
to manually input _any_ configurable binding.
* Localization, since macOS doesn't have any yet. But for Linux when we
port this we probably have to change our strings extraction.

## Demo


https://github.com/user-attachments/assets/a2155cfb-d86b-4c1a-82b5-74ba927e4d69
2025-04-22 08:52:27 -07:00
Mitchell Hashimoto
ce987ba56d macOS: Add dock badge notification for bell events (#7118)
Resolves #7108

This PR adds visual notification badges to the Ghostty dock icon when
bell events are triggered while the application is in the background.
This complements the existing dock bounce notification, making it easier
for users to notice when a terminal needs attention.


https://github.com/user-attachments/assets/b54c881f-fea8-4085-8614-432d9e5847b9
2025-04-22 08:39:49 -07:00
Mitchell Hashimoto
5427b0b507 macOS: add description as hover tooltip 2025-04-22 08:36:17 -07:00
Mitchell Hashimoto
3e5fe5de9a move command filtering into apprt 2025-04-22 08:33:32 -07:00
Mitchell Hashimoto
28404e946b order commands alphabetically and preserve capitalization 2025-04-21 17:13:12 -07:00
Mitchell Hashimoto
7ef9c24e3f renderer/opengl: reduce flickering/stretching on resize (#7155)
Fixes #2446
Supersedes #7144

Two separate issues:

1. Ensure that our screen size matches the viewport size when drawFrame
is called. By the time drawFrame is called, GTK will have updated the
OpenGL context, but our deferred screen size may still be incorrect
since we wait for the pty to update the screen size.

2. Do not clear our cells buffer when the screen size changes, instead
changing to a mechanism that only clears the buffers when we have over
50% wasted space.

/cc @adlr I added you as a coauthor.
2025-04-21 14:39:48 -07:00
Mitchell Hashimoto
e5e9d43d52 renderer/opengl: reduce flickering/stretching on resize
Fixes #2446

Two separate issues:

  1. Ensure that our screen size matches the viewport size when
     drawFrame is called. By the time drawFrame is called, GTK will have
     updated the OpenGL context, but our deferred screen size may still
     be incorrect since we wait for the pty to update the screen size.

  2. Do not clear our cells buffer when the screen size changes, instead
     changing to a mechanism that only clears the buffers when we have
     over 50% wasted space.

Co-authored-by: Andrew de los Reyes <adlr@rivosinc.com>
2025-04-21 14:02:55 -07:00
Tristan Partin
1c62ddffc4 apprt/gtk: add menu to new tab button to create splits
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
Signed-off-by: Tristan Partin <tristan@partin.io>
2025-04-21 13:01:37 -05:00
Mitchell Hashimoto
a732bb272d fix CI 2025-04-21 10:54:23 -07:00