47 Commits

Author SHA1 Message Date
Mitchell Hashimoto
17cae57f51 Introduce reset_window_size keybinding and apprt action
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-28 15:31:17 -08:00
Aswin M Prabhu
a581955b9b Add tab title rename feature to macos 2025-02-14 13:29:36 -08:00
Mitchell Hashimoto
5105c52ef7 macos: make goto_split, goto_tab, and move_tab performable
Fixes #5552

This makes the mentioned actions performable. This isn't perfect, but it
does so in a way that resolves the user issue in #5552. This commit
returns an action is NOT performed if it doesn't have splits or tabs
(respectiely for the actions), but also reports its ALWAYS performed if
it does.

This latter logic isn't accurate: we should only return performable if
it was actually done. So for example, goto_split:top should do nothing
if we're already at the top. But, we report it as performed today.

This is good enough to resolve the issue and fix the core problem faced
for 1.1.0.
2025-02-13 10:40:07 -08:00
Jeffrey C. Ollie
9bac6ecbff macOS: fix iOS build breakage from #5644 2025-02-12 07:54:50 -06:00
Mitchell Hashimoto
cbf562ecb3 apprt/embedded: make performAction return the performable state 2025-02-11 16:43:50 -08:00
Bryan Lee
140ac93884 Add close_tab keybinding action for macOS
Implement `close_tab` keybinding action to close the current tab and all splits within that tab.
2025-01-08 12:04:40 -08:00
Wes Campaigne
e86b9a112e Implement "Paste Selection" on macOS like Terminal.app 2025-01-08 09:26:13 -08:00
Mitchell Hashimoto
e8811ac6fb Move app quit to apprt action
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.
2025-01-04 07:18:53 -08:00
Mitchell Hashimoto
4fdf5eb12b macos: move title setting into a function to better encapsulate 2024-12-12 16:43:22 -08:00
Pranav Mangal
e35bd431f4 Move title change timer to SurfaceView and call it from Ghostty.App instead of terminal controllers 2024-12-12 14:58:42 +05:30
Mitchell Hashimoto
cd49015243 App applies conditional state, supports theme setting
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-22 14:08:35 -08:00
Mitchell Hashimoto
0bb4ca269c macos: use Ghostty logger not AppDelegate 2024-11-22 11:53:52 -08:00
Mitchell Hashimoto
a191f3c396 apprt: switch to reload_config action that calls update_config API 2024-11-22 11:52:34 -08:00
Mitchell Hashimoto
7fb86a3c9c macos: listen for color change property to update window appearance 2024-11-21 13:37:54 -08:00
Mitchell Hashimoto
35fcb1a29b macos: change config access to evented, derived config like libghostty
Previously, we would access the `ghostty.config` object from anywhere.
The issue with this is that memory lifetime access to the underlying
`ghostty_config_t` was messy. It was easy when the apprt owned every
reference but since automatic theme changes were implemented, this isn't
always true anymore.

To fix this, we move to the same pattern we use internally in the core
of ghostty: whenever the config changes, we handle an event, derive our
desired values out of the config (copy them), and then let the caller
free the config if they want to. This way, we can be sure that any
information we need from the config is always owned by us.
2024-11-21 11:36:51 -08:00
Mitchell Hashimoto
3afb9065f0 macos: listen for config change and post a notification 2024-11-21 10:30:27 -08:00
Mitchell Hashimoto
4d9143f634 macos: use the pwd apprt action to set the proxy icon URL 2024-11-13 13:11:32 -08:00
Mitchell Hashimoto
1065359b9a apprt: rename set_bg/fg to "color_change" to report all color changes 2024-10-30 16:33:18 -04:00
Mitchell Hashimoto
de5ec5d83e macos: make move_tab work 2024-10-25 11:54:07 -07:00
Mitchell Hashimoto
8994a8c627 macos: implement key sequence UI 2024-10-08 21:58:53 -07:00
Mitchell Hashimoto
5c1ffbb642 apprt: implement key_sequence action 2024-10-08 21:55:00 -07:00
Mitchell Hashimoto
e56cfbdc8b macos: set the proper app focus state 2024-10-06 10:06:17 -10:00
Mitchell Hashimoto
f9e6d6efa6 macos: forward key events to the app when no windows exist 2024-10-05 10:05:06 -10:00
Roland Peelen
9e00eeff86 Review Feedback - formatting / docs 2024-10-02 10:33:36 -07:00
Roland Peelen
4aac4ecd98 Add hiding toggle, hook up to menu / shortcut 2024-10-02 10:33:36 -07:00
Mitchell Hashimoto
78b9636d15 macos: apply background opacity to quick terminal
Fixes #2331
2024-09-30 21:18:47 -07:00
Mitchell Hashimoto
332e1a1494 macos: new FullscreenMode/Style architecture for fullscreen impls 2024-09-29 21:31:58 -07:00
Mitchell Hashimoto
1570ef01a7 rename slide to quick terminal 2024-09-28 15:20:35 -07:00
Mitchell Hashimoto
99e5e59491 macos: hook up the action for the slide terminal 2024-09-27 18:36:06 -07:00
Mitchell Hashimoto
1bd0999eef macos: add unhandled action 2024-09-27 10:18:01 -07:00
Mitchell Hashimoto
4ae20212bf libghostty: unified action dispatch
First, this commit modifies libghostty to use a single unified action
dispatch system based on a tagged union versus the one-off callback
system that was previously in place. This change simplifies the code on
both the core and consumer sides of the library. Importantly, as we
introduce new actions, we can now maintain ABI compatibility so long as
our union size does not change (something I don't promise yet).

Second, this moves a lot more of the functions call on a surface into
the action system. This affects all apprts and continues the previous
work of introducing a more unified API for optional surface features.
2024-09-26 22:00:11 -07:00
Mitchell Hashimoto
02d7e766e1 core: move password input into action enum 2024-09-25 11:43:48 -07:00
Mitchell Hashimoto
1b31663865 apprt/embedded: new_window can be called without a parent 2024-09-24 18:33:10 -07:00
Mitchell Hashimoto
a513a02328 config: config to disable auto secure input and secure input overlay 2024-09-19 17:20:54 -07:00
Mitchell Hashimoto
1ed1c73c1a macos: enable secure input on password input 2024-09-19 16:38:32 -07:00
Mitchell Hashimoto
c0e0eff468 core: add toggle_secure_input keybinding 2024-09-19 10:20:30 -07:00
pnodet
7ff9af1520 style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Mitchell Hashimoto
9785130c03 macos: add "Reset Terminal" context menu option 2024-08-01 14:58:03 -07:00
Mitchell Hashimoto
9344676960 macos: fix iOS build 2024-07-06 10:45:57 -07:00
Mitchell Hashimoto
cb790b8e39 macos: show URL on OSC8 hover 2024-07-06 10:25:12 -07:00
Qwerasd
d1ac0aff39 feat(macOS): Paste copied files as absolute paths.
Previously files would be pasted as only the filename. This commit
introduces an extension to NSPasteboard which provides a method to
consistently get the string contents of a pasteboard so that the
behavior can stay the same anywhere where we need to do that.
2024-03-07 20:53:48 -05:00
Pete Schaffner
375df57155 Tint split view divider based on theme background 2024-01-29 21:58:13 +01:00
Mitchell Hashimoto
376345dcae macos: detect renderer health failures and show error view 2024-01-16 11:27:18 -08:00
Mitchell Hashimoto
875a774d4b macos: remove AppState and unify onto Ghostty.App cross-platform 2024-01-14 19:35:57 -08:00
Mitchell Hashimoto
5e69b30240 macos: iOS Ghostty.App converted to use Ghostty.Config 2024-01-14 15:55:31 -08:00
Mitchell Hashimoto
65fd02817e macos: only load config files on macos target 2024-01-14 14:53:00 -08:00
Mitchell Hashimoto
4d9fd2becc macos: iOS app can initialize Ghostty 2024-01-14 14:44:16 -08:00