Commit Graph

232 Commits (1a117c46e03f863a383dc9833f9950cf95bf59e4)

Author SHA1 Message Date
Mitchell Hashimoto 1a117c46e0
macos: fix missing goto_window union entry 2025-12-13 14:29:09 -08:00
Max Bretschneider b344c978d0 Added GOTO_WINDOW to actions enum 2025-12-13 13:45:45 -08:00
Max Bretschneider 1c1ef99fb1 Window switching initial 2025-12-13 13:45:44 -08:00
Mitchell Hashimoto dc7bc3014e
add apprt action to notify apprt of surface readonly state 2025-12-12 13:13:54 -08:00
Matthew Hrehirchuk 547bcd261d fix: removed apprt action for toggle_readonly 2025-12-12 07:24:22 -08:00
Matthew Hrehirchuk 12bb2f3f47 feat: add readonly surface mode 2025-12-12 07:24:22 -08:00
Mitchell Hashimoto 65cf124e2c
core: change apprt action to enum value instead of a new one 2025-12-11 16:09:45 -08:00
Mitchell Hashimoto 32033c9e1a
core: prompt_tab_title binding and apprt action 2025-12-11 16:03:19 -08:00
George Papadakis 625d7274bf Add close tabs on the right action 2025-12-10 20:14:27 -08:00
Mitchell Hashimoto 2ee2d000f5
apprt actions for search progress 2025-11-26 08:50:05 -08:00
Mitchell Hashimoto b7e70ce534
apprt: end_search 2025-11-26 08:50:04 -08:00
Mitchell Hashimoto aeaa8d4ead
add start_search binding and apprt action 2025-11-26 08:50:03 -08:00
Mitchell Hashimoto 901708e8da
input: write_*_file actions take an optional format
Fixes #9398
2025-10-31 09:49:59 -07:00
Mitchell Hashimoto 0f1c46e4a4
macos: support setting multiple clipboard content types 2025-10-30 14:01:58 -07:00
Mitchell Hashimoto da7736cd44
renderer: emit scrollbar apprt event when scrollbar changes 2025-10-15 21:45:01 -07:00
Jeffrey C. Ollie 07124dba64
core: add 'command finished' notifications
Fixes #8991

Uses OSC 133 esc sequences to keep track of how long commands take to
execute. If the user chooses, commands that take longer than a user
specified limit will trigger a notification. The user can choose between
a bell notification or a desktop notification.
2025-10-02 12:40:40 -05:00
CoderJoshDK dc03a47558
chore: sync changes with ghostty_string_s 2025-09-24 17:47:24 -04:00
CoderJoshDK c5786c5d38
fix: alloc free off by one 2025-09-24 16:58:39 -04:00
Mitchell Hashimoto e8217aa007
macOS: firstRect should return full rect width/height
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-09-02 13:08:46 -07:00
Mitchell Hashimoto 0b58830882
macOS: Progress bar for OSC9 progress reports 2025-08-31 20:42:34 -07:00
Mitchell Hashimoto f1ea30dcf1
macos: when executing a script directly, always wait after command 2025-08-28 11:26:33 -07:00
Mitchell Hashimoto a90bf58080
config: change quick terminal size C layout to tagged union 2025-08-26 09:52:26 -07:00
Friedrich Stoltzfus 466fdfffe6 macOS: rename c struct, relocate QuickTerminalSize file
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-26 09:47:31 -07:00
Friedrich Stoltzfus 17f7f204e1 macOS: update zig and c structs for quick terminal size
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-26 09:47:31 -07:00
Friedrich Stoltzfus 63cd424678 macOS: Add support for quick terminal sizing configuration
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-26 09:47:31 -07:00
Jeffrey C. Ollie 52a25e9c69
parameterize close_tab
- 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-25 11:00:26 -05:00
jamylak c26323d697 Close other tabs feature on Mac.
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-24 07:55:08 -07:00
Leah Amelia Chen 23048dbd33
gtk-ng: add show_on_screen_keyboard binding 2025-08-14 04:06:02 +08:00
Mitchell Hashimoto f0a0333bc0
apprt/gtk-ng: hook up surface render 2025-07-18 12:43:24 -07:00
Jeffrey C. Ollie 7a60fb2d08
core/gtk: add support for displaying a progress bar with OSC 9;4
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-17 22:36:27 -05:00
Jeffrey C. Ollie 58867b0717
cli/gtk: add some more C bits 2025-07-14 14:48:12 -05:00
Jeffrey C. Ollie 81358c8dca
cli/gtk: replace @hasDecl for performAction-style API
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-14 14:48:11 -05:00
Jeffrey C. Ollie 033d8c3099
core/gtk: add apprt action to show native GUI warning when child exits
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-11 22:56:20 -05:00
Mitchell Hashimoto 20bb71c627
libghostty: export benchmark CLI API 2025-07-09 15:06:24 -07:00
Mitchell Hashimoto b7ffbf933f
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).
2025-07-06 21:01:01 -07:00
Mitchell Hashimoto cbcb0b795c
Fallback to cross-platform minimal open when apprt is not available 2025-07-06 15:15:48 -07:00
Jeffrey C. Ollie 9583ea1b7a core/gtk: open urls using an apprt action instead of doing it directly
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-06 15:02:48 -07:00
Mitchell Hashimoto 984d123fe4
macos: support configuration via CLI arguments
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-07-05 21:31:23 -07:00
Mitchell Hashimoto 471098df30
macOS: Run scripts using stdin rather than executing directly
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-22 21:06:32 -04:00
Mitchell Hashimoto f8bc9b547c
macos: support env vars for surface config, clean up surface config 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto e1ee180172
apprt/embedded: API to read text can get top left/bottom right coords 2025-06-15 13:06:38 -07:00
Mitchell Hashimoto c5f921bb06
apprt/embedded: improve text reading APIs (selection, random points) 2025-06-15 07:59:19 -07:00
Mitchell Hashimoto 6e77a5a6ca
macos: address quick terminal basic functionality with new API 2025-06-07 13:07:31 -07:00
Mitchell Hashimoto b044f4864a
add undo/redo keybindings, default them on macOS 2025-06-07 12:46:14 -07:00
Jeffrey C. Ollie d3cb6d0d41
GTK: add action to show the GTK inspector
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-29 16:07:57 -05:00
Jörg Thalheim a8651882a7 add cut/copy/paste keys
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-24 00:29:53 +02:00
Aaron Ruan 7ccc181332
macos: add "Check for Updates" action, menu item & key-binding support 2025-05-15 13:34:44 +08:00
Mitchell Hashimoto ed1194cd75
fix tests 2025-05-10 08:51:08 -07:00
Mitchell Hashimoto ffdf86374a
apprt/gtk: build 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto b991d36343
macOS: build 2025-05-09 10:01:06 -07:00