149 Commits

Author SHA1 Message Date
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
5259d0fa55 macos: starting to work on new libghostty data models 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
3e02c0cbd5 macos: fix an incorrect bindable write during view update 2025-06-07 12:46:14 -07:00
Aaron Ruan
5f6a15abef Add bell feature flags for audio, attention, and title actions on macOS
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-06-06 23:54:34 +08:00
Mitchell Hashimoto
01fa87f2ab macos: fix iOS builds 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
9474092f77 macos: remove the old split implementation 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
8b979d6dce macos: handle surfaceTreeDidChange 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
2caa8a3fe1 macOS: move window title handling fully to AppKit
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.
2025-05-06 14:57:19 -07:00
Asadullah Shaikh
9709d934f0 remove "r" & "c" from resize overlay on macOS 2025-04-21 20:25:25 +05:30
Mitchell Hashimoto
cc690eddb5 macOS: Implement basic bell features (no sound)
Fixes #7099

This adds basic bell features to macOS to conceptually match the GTK
implementation. When a bell is triggered, macOS will do the following:

  1. Bounce the dock icon once, if the app isn't already in focus.
  2. Add a bell emoji (🔔) to the title of the surface that triggered
     the bell. This emoji will be removed after the surface is focused
     or a keyboard event if the surface is already focused. This
     behavior matches iTerm2.

This doesn't add an icon badge because macOS's dockTitle.badgeLabel API
wasn't doing anything for me and I wasn't able to fully figure out
why...
2025-04-15 10:41:15 -07:00
Mitchell Hashimoto
a2d2cfea59 macos: move drop implementation to separate extension 2025-01-11 19:27:36 -08:00
Mitchell Hashimoto
954c4d7b56 macos: swap out pointerVisible with NSCursor.setHiddenUntilMouseMoves
Fixes #2695

We had various issues with the pointerVisible property on macOS,
including the pointer not being hidden when it should be. Our only use
case today is mouse hide while typing so
NSCursor.setHiddenUntilMouseMoves is a better fit!
2024-11-15 19:05:51 -08:00
Jon Parise
dab3c68311 macos: use a constant for the corner radius 2024-11-15 11:19:00 -05:00
Jon Parise
69f396c252 macos: only round the opposing corner
Also, removing the padding from the window edge.
2024-11-15 11:16:25 -05:00
Jon Parise
07bff5f06d macos: reduce the corner radius to 3 pixels 2024-11-15 10:15:48 -05:00
Jon Parise
d9c9f44d6e macos: add rounded corners to the URL hover view
Also pad the view's position from the corners of the surface.
2024-11-15 09:27:42 -05: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
eec77e271c macos: change our minimum version to macOS 13
macOS 12 is officially EOL by Apple and the project only supports
officially supported versions of macOS. Once publicly released, users on
older macOS versions will have to use older released builds.
2024-10-09 14:41:57 -07:00
Mitchell Hashimoto
8994a8c627 macos: implement key sequence UI 2024-10-08 21:58:53 -07:00
Mitchell Hashimoto
d090384600 macos: fix non-AppKit builds 2024-09-21 10:22:14 -07:00
Mitchell Hashimoto
7f56ea150d typos 2024-09-21 10:00:32 -07:00
Mitchell Hashimoto
f9bd009ce5 macos: unhide cursor on clipboard confirmation 2024-09-21 09:59:40 -07:00
Mitchell Hashimoto
0e1258b7fe macos: pointer style uses macOS 15 helpers 2024-09-20 22:02:21 -07:00
Mitchell Hashimoto
e89a4f7408 macos: use macOS 15 pointerVisibility to show/hide cursor 2024-09-20 22:02:20 -07:00
Mitchell Hashimoto
df5cd719d6 macos: rename overlay config to indication 2024-09-19 20:00:46 -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
9f03aae764 ios: disable secure input 2024-09-19 16:56:46 -07:00
Mitchell Hashimoto
c3d6356a87 macos: show secure input overlay when it is enabled 2024-09-19 16:24:42 -07:00
pnodet
7ff9af1520 style(macos): cleanup trailing spaces 2024-08-21 21:53:09 +02:00
Mitchell Hashimoto
2e0e8897e7 macos: avoid showing overlay if gained focus recently 2024-08-11 11:07:07 -07:00
Mitchell Hashimoto
4680c87c8b macos: pause resize overlay until 500ms passes 2024-08-11 10:34:53 -07:00
Mitchell Hashimoto
0e2012617e macos: truncate tail of resize view 2024-08-10 21:01:29 -07:00
Mitchell Hashimoto
1c982278f3 macos: use dedicated overlay view for resize overlay 2024-08-10 20:56:21 -07:00
Mitchell Hashimoto
9cf247bb3e macos: implement resize overlay
Implements the resize overlay configurations completely.
2024-08-10 20:17:33 -07:00
Mitchell Hashimoto
eaa7a3f69c macos: left hover needs to be higher Z so it takes mouse priority 2024-07-09 09:18:32 -07:00
Mitchell Hashimoto
4d3797c15e macos: limit URL preview to a single line, ellipses in middle 2024-07-09 09:15:45 -07:00
Mitchell Hashimoto
571182fb60 macos: move OSC8 URL view to right if mouse is over it 2024-07-06 21:33:42 -07:00
Mitchell Hashimoto
cb790b8e39 macos: show URL on OSC8 hover 2024-07-06 10:25:12 -07:00
Mitchell Hashimoto
d5a23e78fe macos: some disabled swiftui code that makes link tooltips show 2024-07-06 10:01:35 -07:00
Qwerasd
5df0935f82 update font_size to f32 in libghostty 2024-05-09 00:03:40 -04:00
Mitchell Hashimoto
9aadf59ab1 macos,libghostty: font size is a u8 2024-03-27 20:53:03 -07:00
Mitchell Hashimoto
118b51157a macos: more robust surface focus state detection
Fixes #1500

This overhauls how we do focus management for surfaces to make it more
robust. This DID somehow all work before but was always brittle and was
a sketchy play with SwiftUI/AppKit behavior across macOS versions.

The new approach uses our window controller and terminal delegate
system to disseminate focus information whenever any surface changes
focus. This ensures that only ONE surface ever has focus in libghostty
because the controller ensures it is widely distributed.
2024-02-11 09:19:13 -08:00
Mitchell Hashimoto
487c22011c macos: make SurfaceView cross-platform! 2024-01-18 19:28:36 -08:00
Mitchell Hashimoto
01afa293c8 apprt/embedded: fix initialization on macOS 2024-01-18 08:55:03 -08:00
Mitchell Hashimoto
2568b4979b macos: allow first click when non-focused to shift focus
This allows for example clicking on a split when focused on a different
app and having focus immediately jump to that split. Before this, you'd
have to click to focus the window, then second click to focus on the
split.
2024-01-17 20:30:34 -08:00
Mitchell Hashimoto
ed3f1df5f0 Merge pull request #1316 from qwerasd205/macos-file-handler
Added macOS file open handler
2024-01-16 18:56:34 -08:00
Mitchell Hashimoto
1005116f03 macos: detect error during surface initialization and render 2024-01-16 18:50:47 -08:00
Qwerasd
51f53aa9bf Added macOS file open handler 2024-01-16 16:26:21 -05:00
Mitchell Hashimoto
376345dcae macos: detect renderer health failures and show error view 2024-01-16 11:27:18 -08:00