54 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2390668834 macos: encode surface tree in state restore 2023-12-23 13:15:46 -08:00
Mitchell Hashimoto
59f54a1d88 macos: initial window save/restore is working for frames only 2023-12-22 21:24:27 -08:00
Gregory Anders
f7033524ec macos: add generated Vim plugin files to app bundle 2023-12-21 21:49:36 -06:00
Mitchell Hashimoto
fc897067a6 macos: reordering some files 2023-12-21 17:59:16 -08:00
Gregory Anders
18f2fb3fbd macos: include ghostty subdirectory under Resources
This enables us to treat Ghostty's resources directory the same way
whether it is installed in a macOS app bundle or under e.g. /usr/share.
2023-12-21 17:56:57 -08:00
Mitchell Hashimoto
3762f8c342 macos: make default config ReleaseLocal 2023-12-20 14:37:48 -08:00
Leo Razoumov
d568ef5b97 fix(macos): ReleaseLocal build configuration with "Library Validation" disabled
Fixes #1133

MacOS: If ghostty build succeeds but it crashes at startup due to a library or framework failing
to load, build it with `xcodebuild -configuration ReleaseLocal`
2023-12-20 16:54:58 -05:00
Mitchell Hashimoto
25342f545b macos: add update delegate so we can configure some behavior 2023-12-18 19:09:45 -08:00
Mitchell Hashimoto
caf6ebc6ef macos: add Sparkle via Swift PM 2023-12-18 19:09:38 -08:00
Mitchell Hashimoto
2e74a0f9d4 macos: custom about window so we can be a first responder
Fixes #1052

This implements the about window as a custom window with a view
controller. This lets us implement the proper responder chain so that
our custom close window IBActions do the right thing.

This has an additional benefit that we can easily customize this window
going forward.
2023-12-17 15:51:04 -08:00
Mitchell Hashimoto
a6457c2c1c macos: copy themes 2023-11-22 21:37:59 -08:00
Gregory Anders
86245ff0cf macos: add option to prompt user for confirmation on OSC 52 commands 2023-11-10 23:12:39 -05:00
Mitchell Hashimoto
5f5f5a44ec macos: paste protection boilerplate 2023-11-04 20:15:39 -07:00
Mitchell Hashimoto
60713b46e9 macos: terminal window must subclass nswindow to receive events
Fixes #788
2023-11-02 22:00:33 -07:00
Mitchell Hashimoto
f6d98ae40f macos: delete Ghostty.SplitView 2023-10-30 14:39:26 -07:00
Mitchell Hashimoto
b40245f01d macos: remove old primary window stuff 2023-10-30 14:36:20 -07:00
Mitchell Hashimoto
c86faa37c2 macos: terminal controller owns split data 2023-10-30 14:31:04 -07:00
Mitchell Hashimoto
704c303cd1 macos: working on the new terminalmanager 2023-10-30 09:06:24 -07:00
Mitchell Hashimoto
3018377389 macos: wip 2023-10-30 09:06:24 -07:00
Mitchell Hashimoto
981efb11db macos: add HostingWindow helper 2023-10-30 09:06:23 -07:00
Gregory Anders
2ee80a52df macos: set window resizeIncrements when cell size changes
The resizeIncrements property is only modified when the cell size of the
focused window changes. If two splits have the same cell size then the
property is not modified when focusing between the two splits.
2023-10-26 20:27:58 -05:00
Mitchell Hashimoto
69cc6d11dc macos: MetalView, render an MTKView 2023-10-24 15:27:14 -07:00
Mitchell Hashimoto
a040e807e8 macos: implement service provider 2023-10-04 12:11:23 -07:00
Mitchell Hashimoto
f987a36fce macos: escape shell-sensitive characters on filepath drop 2023-10-04 10:49:32 -07:00
Mitchell Hashimoto
cdbf16e13b macos: set env var for app bundle to detect app launch vs CLI 2023-09-20 11:10:46 -07:00
Mitchell Hashimoto
423e55ce0f macos: change executale name to "ghostty" (lowercase)
This way we can also put this on the PATH and use it as a CLI...
2023-09-20 10:13:12 -07:00
Mitchell Hashimoto
db799d53e6 macos: UI for configuration errors 2023-09-11 13:21:13 -07:00
Mitchell Hashimoto
52396304ff macos: begin syncing menuitem key equivalents 2023-08-30 22:45:29 -07:00
Mitchell Hashimoto
3d23f26326 input, macos: initial work on keymapper and macos usage of it 2023-08-11 12:01:58 -07:00
Mitchell Hashimoto
9105637697 macos: reorganize, rename, put files in groups 2023-08-04 17:17:18 -07:00
Mitchell Hashimoto
bf190ba442 macos: merge AppController and AppDelegate, organize groups 2023-08-04 17:05:52 -07:00
Thorsten Ball
850bf3e945 macos: add support for non-native fullscreen mode
This adds support for what's commonly referred to as "non-native
fullscreen": a fullscreen-mode that doesn't use macOS' native fullscreen
mechanism and thus doesn't use animations and a separate space on which
to display the fullscreen window. Instead it's really fast and it allows
the user to `Cmd+tab` to other windows, with the fullscreen-ed window
staying in the background.

Another name for it is "traditional fullscreen" since it was the default
pre Mac OS X Lion, if I remember correctly.

Other applications that offer macOS non-native fullscreen:

- Kitty: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.macos_traditional_fullscreen
- wezterm: https://wezfurlong.org/wezterm/config/lua/config/native_macos_fullscreen_mode.html
- MacVim
- IINA: fc66b27d50/iina/MainWindowController.swift (L1401-L1423)
- mpv: https://mpv.io/manual/stable/#options-native-fs
- iTerm2

Adding this wasn't straightforward, as it turned out. Mainly because
SwiftUI's app lifecycle management doesn't allow one to use a custom
class for the windows it creates. And without custom classes we'd always
get a warning when entering/leaving fullscreen mode.

So what I did here is the following:

- remove SwiftUI app lifecycle management
- introduce `MainMenu.xib` to define the main menu via interface builder
- add `GhosttyAppController` to handle requests from the app
- add a `main.swift` file to boot up the app without a storyboard and
  without SwiftUI lifecycle management
- introduce the `FullScreenHandler` to manage non-native fullscreen -
  this is where the "magic" is

But since removing the SwiftUI lifecycle management also means removing
the top-level `App` that means I had to introduce the menu (which I
mentioned), but also tab and window management.

So I also added the `WindowService` which manages open tabs and windows.
It's based on the ideas presented in

    https://christiantietze.de/posts/2019/07/nswindow-tabbing-multiple-nswindowcontroller/

and essentially keeps tracks of windows.

Then there's some auxilliary changes: `CustomWindow` and `WindowController` and so on.

Now everything still works, in addition to non-native fullscreen:

* opening/closing of tabs
* opening/closing of windows
* splits
* `gotoTab`

Worthy of note: when toggling back from non-native fullscreen to
non-fullscreen I had to manually implement the logic to re-add the
window back to a tabgroup. The only other app that supports tabs with
non-native FS is iTerm2 and they have implemented their own tab
management to keep the tab bar even in non-native FS -- that's a bit too
much for me. Every other app has non-native apps and doesn't have to
wory about it.
2023-08-04 14:12:30 -07:00
Mitchell Hashimoto
ad62e3ac1b fish shell integration 2023-07-06 16:10:30 -07:00
Mitchell Hashimoto
f9978e8524 build: Copy terminfo resources from xcodeproj
This should fix #158. Instead of manually copying the resources, we
create a relative dependency from the xcodeproj directly so that
xcodebuild should handle this for us.
2023-06-25 09:09:23 -07:00
Mitchell Hashimoto
1d14b121c0 renderer: do not draw cursor cell inversion if we don't draw the cursor
We previously used the "screen.viewportIsBottom" check but this is
always true since awhile back since we copy only the viewport now. A
cleaner check really is that we only track the cursor cell if we're even
drawing the cursor.
2023-05-25 21:41:43 -07:00
Mitchell Hashimoto
ef30ad394d macos: only show confirm quit on focused window 2023-03-27 09:52:38 -07:00
Mitchell Hashimoto
92870e4e60 macos: confirm on quit 2023-03-27 09:41:00 -07:00
Mitchell Hashimoto
a6b43fa694 macos: set default window size on macOS 13+ 2023-03-15 15:03:45 -07:00
Mitchell Hashimoto
e07a4e6892 macos: comment my split view 2023-03-07 17:04:12 -08:00
Mitchell Hashimoto
d00794de8e macos: working on custom split view 2023-03-07 16:22:00 -08:00
Mitchell Hashimoto
1faca5972f macos: change key window detection 2023-03-06 21:53:22 -08:00
Mitchell Hashimoto
1a3cd852f9 macos: massive reorg 2023-03-06 21:28:09 -08:00
Mitchell Hashimoto
b1d57cd500 macos: rename TerminalSurfaceView to TerminalSurface 2023-03-05 13:18:56 -08:00
Mitchell Hashimoto
dc598a3dd7 macos: update minimum deployment target to macOS 12 2023-02-22 14:41:12 -08:00
Mitchell Hashimoto
1e09a1f2e1 macos: add settings view with a coming soon to help some people 2023-02-19 16:00:05 -08:00
Mitchell Hashimoto
6b450f7c7d macos: track surface focus state 2023-02-19 10:44:57 -08:00
Mitchell Hashimoto
57551e3990 macos: disable sandbox 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
ff9af8a07b lots of progress running a surface but still crashes 2023-02-19 10:44:56 -08:00
Mitchell Hashimoto
6ceb5b847b macos: terminal surface view 2023-02-19 10:44:55 -08:00
Mitchell Hashimoto
2b3531378f build: bundle compiler rt 2023-02-19 10:44:54 -08:00