diff options
| author | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-06 20:23:20 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <m@mitchellh.com> | 2025-07-06 21:01:01 -0700 |
| commit | b7ffbf933f1b2274a14f6471eb932fee0987096a (patch) | |
| tree | 891167c5e1a4543d645b38b3c7a9d007311567bc /include | |
| parent | db45fab85ee2a3038ced3e2fa3def83e22234620 (diff) | |
macos: open URLs with NSWorkspace APIs instead of `open`
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).
Diffstat (limited to 'include')
| -rw-r--r-- | include/ghostty.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/ghostty.h b/include/ghostty.h index 2a4a7fb6e..312e6595a 100644 --- a/include/ghostty.h +++ b/include/ghostty.h @@ -351,6 +351,11 @@ typedef struct { } ghostty_diagnostic_s; typedef struct { + const char* ptr; + uintptr_t len; +} ghostty_string_s; + +typedef struct { double tl_px_x; double tl_px_y; uint32_t offset_start; @@ -797,6 +802,7 @@ int ghostty_init(uintptr_t, char**); void ghostty_cli_try_action(void); ghostty_info_s ghostty_info(void); const char* ghostty_translate(const char*); +void ghostty_string_free(ghostty_string_s); ghostty_config_t ghostty_config_new(); void ghostty_config_free(ghostty_config_t); @@ -811,7 +817,7 @@ ghostty_input_trigger_s ghostty_config_trigger(ghostty_config_t, uintptr_t); uint32_t ghostty_config_diagnostics_count(ghostty_config_t); ghostty_diagnostic_s ghostty_config_get_diagnostic(ghostty_config_t, uint32_t); -void ghostty_config_open(); +ghostty_string_s ghostty_config_open_path(void); ghostty_app_t ghostty_app_new(const ghostty_runtime_config_s*, ghostty_config_t); |
