summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)Author
2025-09-29fix: alloc free off by one (#8886)Mitchell Hashimoto
Fix provided by @jcollie The swift `open_config` action was triggering an allocation error `error(gpa): Allocation size 41 bytes does not match free size 40.`. > A string that was created as a `[:0]const u8` was cast to `[]const u8` and then freed. The sentinel is the off-by-one. @jcollie For full context, see https://discord.com/channels/1005603569187160125/1420367156071239820 Co-authored-by: Jeffrey C. Ollie <jcollie@dmacc.edu>
2025-09-02macOS: firstRect should return full rect width/heightMitchell Hashimoto
Fixes #2473 This commit changes `ghostty_surface_ime_point` to return a full rect with the width/height calculated for the preedit. The `firstRect` function, which calls `ghostty_surface_ime_point` was previously setting the width/height to zero. macOS didn't like this. We then changed it to just hardcode it to width/height of one cell. This worked but made it so the IME cursor didn't follow the preedit.
2025-08-31macOS: Progress bar for OSC9 progress reportsMitchell Hashimoto
2025-08-28macos: when executing a script directly, always wait after commandMitchell Hashimoto
2025-08-26config: change quick terminal size C layout to tagged unionMitchell Hashimoto
2025-08-26macOS: rename c struct, relocate QuickTerminalSize fileFriedrich Stoltzfus
Renamed the ghostty_quick_terminal_size_u to ghostty_quick_terminal_size_s and moved the QuickTerminalSize file to the Ghostty folder as requested.
2025-08-26macOS: update zig and c structs for quick terminal sizeFriedrich Stoltzfus
Applying the feedback given by @pluiedev to use an enum to specify the type of quick terminal size configuration given (pixels or percentage). Updated the Swift code to work with the enum as well.
2025-08-26macOS: Add support for quick terminal sizing configurationFriedrich Stoltzfus
Added C bindings for the already existing quick-terminal-size configuration. Created a new QuickTerminalSize struct to hold these values in Swift. Updated the QuickTerminal implementation to use the user's configuration if supplied. Retains defaults. Also adds support to customize the width of the quick terminal (height if quick terminal is set to right or left).
2025-08-25parameterize close_tabJeffrey C. Ollie
- Add mode (`this`/`other`) parameter to `close_tab` keybind/apprt action. - Keybinds will default to `this` if not specified, eliminating backward compatibility issues (`keybind=x=close_tab` === `keybind=x=close_tab:this`). - Remove `close_other_tabs` keybind and apprt action.
2025-08-24Close other tabs feature on Mac.jamylak
Supporting command line, file menu and keybindings. Default mac shortcut of `super + alt + o` (other) Not able to test on Linux so excluding `close_other_tabs` from `gtk` for now make a default short cut for close other tabs
2025-08-14gtk-ng: add show_on_screen_keyboard bindingLeah Amelia Chen
2025-07-18apprt/gtk-ng: hook up surface renderMitchell Hashimoto
2025-07-17core/gtk: add support for displaying a progress bar with OSC 9;4Jeffrey C. Ollie
Ghostty has had support for a while (since PR #3124) for parsing progress reports but never did anything with them. This PR adds the core infrastructure and an implementation for GTK. On GTK, the progress bar will show up as a thin bar along the top of the terminal. Under normal circumstances it will use whatever you have set as your accent color. If the progam sending the progress report indicates an error, it will change to a reddish color.
2025-07-14cli/gtk: add some more C bitsJeffrey C. Ollie
2025-07-14cli/gtk: replace @hasDecl for performAction-style APIJeffrey C. Ollie
Instead of using @hasDecl, use a performAction-stype API. The C interface for interfacing with macOS (or any other apprt where Ghostty is embedded) is unfinished.
2025-07-11core/gtk: add apprt action to show native GUI warning when child exitsJeffrey C. Ollie
Addresses #7649 for the core and GTK. macOS support will need to be added later. This adds an apprt action to show a native GUI warning of some kind when the child process of a terminal exits. Also adds a basic GTK implementation of this. In GTK it overlays an Adwaita banner at the bottom of the window (similar to the banner that shows up in at the top of windows in debug builds).
2025-07-09libghostty: export benchmark CLI APIMitchell Hashimoto
2025-07-06macos: open URLs with NSWorkspace APIs instead of `open`Mitchell Hashimoto
Fixes #5256 This updates the macOS apprt to implement the `OPEN_URL` apprt action to use the NSWorkspace APIs instead of the `open` command line utility. As part of this, we removed the `ghostty_config_open` libghostty API and instead introduced a new `ghostty_config_open_path` API that returns the path to open, and then we use the `NSWorkspace` APIs to open it (same function as the `OPEN_URL` action).
2025-07-06Fallback to cross-platform minimal open when apprt is not availableMitchell Hashimoto
2025-07-06core/gtk: open urls using an apprt action instead of doing it directlyJeffrey C. Ollie
Partial implementation of #5256 This implements the core changes necessary to open urls using an apprt action rather than doing it directly from the core. Implements the open_url action in the GTK and GLFW apprts. Note that this should not be merged until a macOS-savvy developer can add an implementation of the open_url action for the macOS apprt.
2025-07-05macos: support configuration via CLI argumentsMitchell Hashimoto
This makes it so `zig build run` can take arguments such as `--config-default-files=false` or any other configuration. Previously, it only accepted commands such as `+version`. Incidentally, this also makes it so that the app in general can now take configuration arguments via the CLI if it is launched as a new instance via `open`. For example: open -n Ghostty.app --args --config-default-files=false This previously didn't work. This is kind of cool. To make this work, the libghostty C API was modified so that initialization requires the CLI args, and there is a new C API to try to execute an action if it was set.
2025-06-22macOS: Run scripts using stdin rather than executing directlyMitchell Hashimoto
Fixes #7647 See #7647 for context. This commit works by extending the `input` work introduced in #7652 to libghostty so that the macOS can take advantage of it. At that point, its just the macOS utilizing `input` in order to set the command and `exit` up similar to Terminal and iTerm2.
2025-06-21macos: support env vars for surface config, clean up surface configMitchell Hashimoto
2025-06-15apprt/embedded: API to read text can get top left/bottom right coordsMitchell Hashimoto
2025-06-15apprt/embedded: improve text reading APIs (selection, random points)Mitchell Hashimoto
2025-06-07macos: address quick terminal basic functionality with new APIMitchell Hashimoto
2025-06-07add undo/redo keybindings, default them on macOSMitchell Hashimoto
2025-05-29GTK: add action to show the GTK inspectorJeffrey C. Ollie
The default keybinds for showing the GTK inspector (`ctrl+shift+i` and `ctrl+shift+d`) don't work reliably in Ghostty due to the way Ghostty handles input. You can show the GTK inspector by setting the environment variable `GTK_DEBUG` to `interactive` before starting Ghostty but that's not always convenient. This adds a keybind action that will show the GTK inspector. Due to API limitations toggling the GTK inspector using the keybind action is impractical because GTK does not provide a convenient API to determine if the GTK inspector is already showing. Thus we limit ourselves to strictly showing the GTK inspector. To close the GTK inspector the user must click the close button on the GTK inspector window. If the GTK inspector window is already visible but is hidden, calling the keybind action will not bring the GTK inspector window to the front.
2025-05-24add cut/copy/paste keysJörg Thalheim
The origin of these keys are old sun keyboards. They are getting picked up by the custom (progammable) keyboard scene (see https://github.com/manna-harbour/miryoku for a popular layout). Support in ghosty is quite handy because it allows to bind copy/paste in a way that doesn't overlap with ctrl-c/ctrl-v, which can have special bindings in some terminal applications.
2025-05-15macos: add "Check for Updates" action, menu item & key-binding supportAaron Ruan
2025-05-10fix testsMitchell Hashimoto
2025-05-09apprt/gtk: buildMitchell Hashimoto
2025-05-09macOS: buildMitchell Hashimoto
2025-05-07core: add context menu keyJeffrey C. Ollie
2025-05-01Binding for toggling window float on top (macOS only)Mitchell Hashimoto
This adds a keybinding and apprt action for #7237.
2025-04-25Add config color palette C bindingsFriedrich Stoltzfus
C bindings to expose the color palette to Swift for macOS.
2025-04-22move command filtering into apprtMitchell Hashimoto
2025-04-21add toggle command palette bindingMitchell Hashimoto
2025-04-21libghostty: add API for getting commandsMitchell Hashimoto
2025-04-21input: defind Command struct and default commandsMitchell Hashimoto
2025-04-17macOS/libghostty: rework keyboard input handlingMitchell Hashimoto
This is a large refactor of the keyboard input handling code in libghostty and macOS. Previously, libghostty did a lot of things that felt out of scope or was repeated work due to lacking context. For example, libghostty would do full key translation from key event to character (including unshifted translation) as well as managing dead key states and setting the proper preedit text. This is all information the apprt can and should have on its own. NSEvent on macOS already provides us with all of this information, there's no need to redo the work. The reason we did in the first place is mostly historical: libghostty powered our initial macOS port years ago when we didn't have an AppKit runtime yet. This cruft has already practically been the source of numerous issues, e.g. #5558, but many other hacks along the way, too. This commit pushes all preedit (e.g. dead key) handling and key translation including unshifted keys up into the caller of libghostty. Besides code cleanup, a practical benefit of this is that key event handling on macOS is now about 10x faster on average. That's because we're avoiding repeated key translations as well as other unnecessary work. This should have a meaningful impact on input latency but I didn't measure the full end-to-end latency. A scarier part of this commit is that key handling is not well tested since its a GUI component. I suspect we'll have some fallout for certain keyboard layouts or input methods, but I did my best to run through everything I could think of.
2025-04-14gtk: implement bellLeah Amelia Chen
Co-authored-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2025-03-07add ghostty_translate C APIMitchell Hashimoto
2025-03-06gtk: add separate close_window apprt actionLeah Amelia Chen
For *some* reason we have a binding for close_window but it merely closes the surface and not the entire window. That is not only misleading but also just wrong. Now we make a separate apprt action for close_window that would make it show a close confirmation prompt identical to as if the user had clicked the (X) button on the window titlebar.
2025-02-28Introduce `reset_window_size` keybinding and apprt actionMitchell Hashimoto
Related to #6035 This implements the keybind/action portion of #5974 so that this can have a binding and so that other apprts can respond to this and implement it this way.
2025-02-14Add tab title rename feature to macosAswin M Prabhu
2025-02-13macos: add `padded-notch` option for `macos-non-native-fullscreen`Mitchell Hashimoto
Finishes #378 Supercedes #4159 This adds a new enum value for `macos-non-native-fullscreen`: `padded-notch`. This value will add padding to the top of the window to account for the notch on applicable devices while still hiding the menu. This value is preferred over "visible-menu" by some people because for screens without a notch, the window will take up the full height. The plan in the future is that we may color the padded area when a notch is present. In this commit it appears as transparent.
2025-02-11apprt/embedded: make performAction return the performable stateMitchell Hashimoto
2025-01-13Handle setting _NET_WM_STATE (#4936)Mitchell Hashimoto
As recommended in https://github.com/ghostty-org/ghostty/pull/4927#issuecomment-2585003934, adds a config option `maximize` for starting a window in a maximized state in terms of window properties. Also adds a `toggle_maximize` keybind to allow users to manually toggle this feature on and off. It might make more sense to make this an optional config value so that we don't toggle the state off if the WM already handles that for us, but I'll let a reviewer decide. Closes https://github.com/ghostty-org/ghostty/issues/4646
2025-01-13Fix backslash comment in ghostty.hAndreas Skielboe