30 Commits

Author SHA1 Message Date
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
Mitchell Hashimoto
c438d72f13 macos: add ErrorView 2023-02-19 10:44:54 -08:00
Mitchell Hashimoto
d2d21801d8 macos: need to link to libstdc++ 2023-02-19 10:44:54 -08:00
Mitchell Hashimoto
4dd4bbf7e0 macos: disable code signing for now 2023-02-19 10:44:54 -08:00
Mitchell Hashimoto
aefec1d6a9 macos: xcodeproj 2023-02-19 10:44:53 -08:00