summaryrefslogtreecommitdiff
path: root/src/App.zig
AgeCommit message (Collapse)Author
2025-07-19core: remove Surface.shouldCloseMitchell Hashimoto
This was a noop in all of our apprts and I think is a holdover from the glfw days.
2025-07-19Fully remove the redrawSurface APIMitchell Hashimoto
This is a tiny addon from the recent gtk-ng work. We've moved redraw requests into the apprt action system (the `render` action). I waited until I had my macOS machine to verify that this fix could work. We can now remove this completely. We can probably remove the redraw inspector API too at some point but I'm not there yet with the GTK backend so I'll just wait on it.
2025-07-18apprt/gtk-ng: hook up surface renderMitchell Hashimoto
2025-07-18apprt/gtk-ng: hook up surface initializationMitchell Hashimoto
2025-06-27reintroduce App.createMitchell Hashimoto
2025-06-27core: con't copy App and apprt.AppJeffrey C. Ollie
Besides avoiding copying, this allows consumers to choose to allocate these structs on the stack or to allocate on the heap. It also gives the apprt.App a stable pointer sooner in the process.
2025-06-07Make undo/redo app-targeted so it works with no windowsMitchell 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-15macos: add "Check for Updates" action, menu item & key-binding supportAaron Ruan
2025-02-11core: performAction now returns a boolJeffrey C. Ollie
This is to facilitate the `performable:` prefix on keybinds that are implemented using app runtime actions.
2025-01-04macos: handle overridden system bindings with no focused windowMitchell Hashimoto
2025-01-04Move app quit to apprt actionMitchell Hashimoto
This changes quit signaling from a boolean return from core app `tick()` to an apprt action. This simplifies the API and conceptually makes more sense to me now. This wasn't done just for that; this change was also needed so that macOS can quit cleanly while fixing #4540 since we may no longer trigger menu items. I wanted to split this out into a separate commit/PR because it adds complexity making the diff harder to read.
2024-11-22App applies conditional state, supports theme settingMitchell Hashimoto
The prior light/dark mode awareness work works on surface-level APIs. As a result, configurations used at the app-level (such as split divider colors, inactive split opacity, etc.) are not aware of the current theme configurations and default to the "light" theme. This commit adds APIs to specify app-level color scheme changes. This changes the configuration for the app and sets the default conditional state to use that new theme. This latter point makes it so that future surfaces use the correct theme on load rather than requiring some apprt event loop ticks. Some users have already reported a short "flicker" to load the correct theme, so this should help alleviate that.
2024-11-22apprt: switch to reload_config action that calls update_config APIMitchell Hashimoto
2024-11-21apprt: add `config_change` actionMitchell Hashimoto
2024-11-07move datastructures to dedicated "datastruct" packageMitchell Hashimoto
2024-11-05config: add "initial-command" config, "-e" sets thatMitchell Hashimoto
Fixes #2601 It is more expected behavior that `-e` affects only the first window. By introducing a dedicated configuration we avoid making `-e` too magical: its simply syntax sugar for setting the "initial-command" configuration.
2024-10-18cli: skip argv0 and actions when parsing CLI flagsMitchell Hashimoto
This fixes a regression from #2454. In that PR, we added an error when positional arguments are detected. I believe that's correct, but we were silently relying on the previous behavior in the CLI commands. This commit changes the CLI commands to use a new argsIterator function that creates an iterator that skips the first argument (argv0). This is the same behavior that the config parsing does and now uses this shared logic. This also makes it so the argsIterator ignores actions (`+things`) and we document that we expect those to be handled earlier.
2024-10-18apprt/glfw: exit with invalid CLI argsMitchell Hashimoto
2024-10-18expand explicit error set usageMitchell Hashimoto
This continues our work to improve the amount of explicit error sets we use in the codebase. Explicit error sets make it easier to understand possible failure scenarios, allow us to use exhaustive matching, create compiler errors if errors are unexpectedly added or removed, etc. The goal eventually is 100% coverage but we're not even close yet. This just moves us a little closer.
2024-10-08input: return a K/V entry for the binding set `get`Mitchell Hashimoto
2024-10-06apprt/gtk: report proper app focus stateMitchell Hashimoto
2024-10-06macos: set the proper app focus stateMitchell Hashimoto
2024-10-06core: add app focused state, make App.keyEvent focus awareMitchell Hashimoto
2024-10-06core: ghostty_app_key only handles global keybinds for nowMitchell Hashimoto
This introduces a separate bug fixes #2396
2024-10-05macos: forward key events to the app when no windows existMitchell Hashimoto
2024-10-02Add action on Zig sideRoland Peelen
2024-09-28rename slide to quick terminalMitchell Hashimoto
2024-09-27core: fix up toggle_slide_terminal action for rebaseMitchell Hashimoto
2024-09-27macos: fix previous/next tab bindings, improve action loggingMitchell Hashimoto
2024-09-25apprt: transition all hasDecls in App.zig to use the new action dispatchMitchell Hashimoto
2024-09-25apprt: begin transition to making actions an enum and not use hasDeclMitchell Hashimoto
2024-09-24apprt/embedded: new_window can be called without a parentMitchell Hashimoto
2024-09-24Tap events, core API to handle global keybindsMitchell Hashimoto
2024-09-23core: handle app bindings in the App structMitchell Hashimoto
2024-08-03apprt/gtk: use tagged union for quit timerMitchell Hashimoto
2024-08-01Improve quit timers.Jeffrey C. Ollie
Instead of "polling" to see if a quit timer has expired, start a single timer that expires after the confiugred delay when no more surfaces are open. That timer can be cancelled if necessary.
2024-05-17Address review commentsJeffrey C. Ollie
1. Switch to using Wyhash instead of a cryptographic hash. 2. Move global variables to App struct.
2024-04-05core: App asserts the font grid set is empty on closeMitchell Hashimoto
2024-04-05core: begin converting to SharedGridSet, renderers still brokenMitchell Hashimoto
2024-04-05core: convert surface/app to use GroupCacheSetMitchell Hashimoto
2023-12-17Add settings shortcut on MacOSBorja Clemente
- Settings shortcut opens the config file in the default editor. Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
2023-12-13core: quit-after-last-window-closed works properly with "exit"Mitchell Hashimoto
Fixes #1085 This moves the logic of exiting when there are no surfaces left fully to apprt and away from the core.
2023-11-22core: move resources dir to main global stateMitchell Hashimoto
2023-11-05windows: add support for the glfw backend on Windowskcbanner
Changes: - Add WindowsPty, which uses the ConPTY API to create a pseudo console - Pty now selects between PosixPty and WindowsPty - Windows support in Command, including the ability to launch a process with a pseudo console - Enable Command tests on windows - Add some environment variable abstractions to handle the missing libc APIs on Windows - Windows version of ReadThread
2023-10-24all threads are notified of inspector state, trigger renderMitchell Hashimoto
2023-10-19fix build with no font discoveryMitchell Hashimoto
2023-09-13core: surface should not use app mailboxMitchell Hashimoto
The surface runs on the same thread as the app so if we use the app mailbox then we risk filling the queue before it can drain. The surface should use the app directly. This commit just changes all the calls to use the app directly. We may also want to coalesce certain changes to avoid too much CPU but I defer that to a future change.
2023-09-11core: app needsConfirmQuit to streamline quitting if no active sessionsMitchell Hashimoto
2023-08-25core: set focused surface pointer to null if matches on deleteMitchell Hashimoto
We previously never set the focused pointer to null. I thought this would be fine because a `hasSurface` check would say it doesn't exist. But I didn't account for the fact that a deleted surface followed very quickly by a new surface would free the pointer, then the allocation would reuse the very same pointer, making `hasSurface` return a false positive. Well, technically, hasSurface is not wrong, the surface exists, but its not really the same surface, its just a surface that happens to have the same pointer as a previously freed surface. Co-authored-by: Will Pragnell <wpragnell@gmail.com>