845 Commits

Author SHA1 Message Date
Mitchell Hashimoto
6e54589db4 misc cleanups 2025-01-08 11:28:09 -08:00
Soh Satoh
37db4578c8 Fix the issue that the quick term not shown on first call 2025-01-08 11:03:18 -08:00
Soh Satoh
0ddc1a21a6 fix the comment (quick-terminal-space-behavior) 2025-01-08 11:03:18 -08:00
Soh Satoh
7bb3c31cee Move the quick terminal to active space if toggle() called while opening on another space 2025-01-08 11:03:18 -08:00
Soh Satoh
1493c55348 Merge branch 'main' into show-quick-term-on-another-app 2025-01-08 11:03:18 -08:00
Soh Satoh
e2523c25cb Add quick-terminal-space-behavior option 2025-01-08 11:02:19 -08:00
Soh Satoh
2206c509be Show quick terminal on another full-screen app 2025-01-08 10:59:56 -08:00
Wes Campaigne
e86b9a112e Implement "Paste Selection" on macOS like Terminal.app 2025-01-08 09:26:13 -08:00
Mitchell Hashimoto
ae0c4d927a macos: halt NSEvent processing at app scope only if event is handled
Fixes #4677
2025-01-06 07:27:44 -08:00
Mitchell Hashimoto
f0c2d3d75a macos: fix retain cycle preventing window from freeing 2025-01-06 07:02:04 -08:00
Mitchell Hashimoto
ed221f32fe macos: ignore modifier changes while IM is active
Fixes #4634
2025-01-05 13:30:50 -08:00
Mitchell Hashimoto
4ffd281de3 macos: detect IME input source change as part of keyDown event
Fixes #4539

AquaSKK is a Japanese IME (Input Method Editor) for macOS. It uses
keyboard inputs to switch between input modes. I don't know any other
IMEs that do this, but it's possible that there are others. Prior to
this change, the keyboard inputs to switch between input modes were
being sent to the terminal, resulting in erroneous characters being
written.

This change adds a check during keyDown events to see if the input
source changed _during the event_. If it did, we assume an IME captured
it and we don't pass the event to the terminal.

This makes AquaSKK functional in Ghostty.
2025-01-04 21:45:25 -08:00
Mitchell Hashimoto
8f5cbed46f fix: macos incorrect quick terminal position (#4501)
As this discussion: #4353
2025-01-04 20:41:53 -08:00
Christian Schneider
a670836d7a Remove outdated comment 2025-01-04 20:18:00 -08:00
Christian Schneider
da80531c22 Implement configuration option split-divider-color for macOS 2025-01-04 20:18:00 -08:00
Mitchell Hashimoto
40bdea7335 macos: handle overridden system bindings with no focused window 2025-01-04 14:07:47 -08:00
Mitchell Hashimoto
1bcfff3b79 macos: manual send keyUp event for command key 2025-01-04 14:02:16 -08:00
Mitchell Hashimoto
3e89c4c2f4 Key events return boolean if handled 2025-01-04 13:36:40 -08:00
Mitchell Hashimoto
4031815a8d macos: if a key event would result in an immediate binding then do it 2025-01-04 12:45:16 -08:00
Mitchell Hashimoto
8b8c53fc4c macos: add NSEvent extension to convert to libghostty key events 2025-01-04 12:45:15 -08:00
Mitchell Hashimoto
e8811ac6fb Move app quit to apprt action
This changes quit signaling from a boolean return from core app `tick()`
to an apprt action. This simplifies the API and conceptually makes more
sense to me now.

This wasn't done just for that; this change was also needed so that
macOS can quit cleanly while fixing #4540 since we may no longer trigger
menu items. I wanted to split this out into a separate commit/PR because
it adds complexity making the diff harder to read.
2025-01-04 07:18:53 -08:00
acehinnnqru
b0404867b7 fix: macos incorrect quick terminal position 2025-01-03 22:44:26 +08:00
Mitchell Hashimoto
b65c26966a macos: fix window borders on dark mode (#4308)
After updating to 1.0.1 I noticed something different in the terminal,
which turned out being the window borders - it appeared as if Ghostty
was using light-mode style borders (dark/black outline with a thin light
stroke at the top) instead of the entire light outline from before:

| 1.0.0 | 1.0.1 |
| - | - |
| <img width="308" alt="Screenshot 2025-01-01 at 2 28 12 PM"
src="https://github.com/user-attachments/assets/d8bc5bdd-c3b2-401c-a8ed-9da0b768cb3d"
/> | <img width="308" alt="Screenshot 2025-01-01 at 2 29 07 PM"
src="https://github.com/user-attachments/assets/fd710bed-1756-4f66-8402-bfbdd25218ab"
/> |

After digging a bit, I found #3834, which fixes fullscreen background
colors through alpha channels by appending a `withAlphaComponent(0.0)`
to `backgroundColor` - for reasons I may be entirely unaware of (since
I'm not a Swift developer), this seems to cause the dark-mode border
style to go away.

Some lines above that, I noticed the `.clear` callout from line 266,
which talks about matching Terminal.app's styles, and it _also_ has a
`withAlphaComponent` but set to `0.001` - if I understand correctly, and
the fix from #3834 works by setting the alpha component to a
_practically_ zero value, then I thought perhaps a really small number
like `0.001` could do the trick as well. This ended up working and
bringing back the right borders again.

Not sure again if this may make a difference anywhere else in the app or
bring any undesired behavior, but if anyone who is well-versed in Swift
would like chime in with more details or perhaps a better approach, I'd
greatly appreciate it!
2025-01-02 15:41:57 -08:00
Gabriel Moreno
82695edaff macos: fix window borders on dark mode 2025-01-02 15:27:01 -08:00
Mitchell Hashimoto
7eb6b29d4c macos: make auto-update optional (#4436)
When unset, we use Sparkle's default behavior, which is based on the
user's preference stored in the standard user defaults.

The rest of the previous behavior is preserved:
- When SUEnableAutomaticChecks is explicitly false, auto-updates are
disabled.
- When 'auto-update' is set, use its value to set Sparkle's auto-update
behavior.

Fixes #4433
2025-01-02 13:38:15 -08:00
Mitchell Hashimoto
29b96be84f tweaks to window position 2025-01-02 13:18:53 -08:00
Adam Wolf
f9250e28b5 chore: rename window-position-{x,y} to window-initial-position-{x,y} 2025-01-02 12:58:40 -08:00
Adam Wolf
200d0d642b macos: handle setting initial window position when window is created 2025-01-02 12:58:40 -08:00
Adam Wolf
9a58de6d5a feat(macos): allow setting an intial start position 2025-01-02 12:58:40 -08:00
Jon Parise
713dd24ab9 macos: make auto-update optional
When unset, we use Sparkle's default behavior, which is based on the
user's preference stored in the standard user defaults.

The rest of the previous behavior is preserved:
- When SUEnableAutomaticChecks is explicitly false, auto-updates are
  disabled.
- When 'auto-update' is set, use its value to set Sparkle's auto-update
  behavior.
2025-01-02 15:53:01 -05:00
Christoffer Tønnessen
88674a1957 Restore hidden titlebar after fullscreen
This fixes https://github.com/ghostty-org/ghostty/issues/3535 .

There exists an issue in ghostty on mac where if you have hidden your
titlebar, then enter fullscreen, the titlebar will reappear after
exiting fullscreen.

The reason for this is that after exiting fullscreen macos reapplies
some styling on the new window created after exiting fullscreen. To
combat this we will reapply the styling to hide the titlebar after
exiting fullscreen.

Required config:
```
macos-titlebar-style = hidden
macos-non-native-fullscreen = true
```

Steps to reproduce:

- Open Ghostty
- Enter fullscreen (non-native)
- Exit fullscreen

On main you will see the titlebar reappearing after exiting fullscreen,
while that does not happen with this patch.
2025-01-02 12:25:02 -08:00
Mitchell Hashimoto
9503c9fe50 Rename goto_split top/bottom directions to up/down. (#3427)
Renames the top/bottom directions of `goto_split` to up/down. I have
tested this on linux (nixos) but given that `goto_split` is broken on
linux anyway (#2866) there's not a whole lot to test.

I have no way to build on macOS so I can't verify that I've changed
everything correctly for that.

Closes #3237
2025-01-02 07:08:16 -08:00
Mitchell Hashimoto
dd41a9447d macOS: weak self for event monitor to avoid retain cycle for controllers
Fixes #3219

We were holding a reference cycle to the base terminal controller. This
was preventing the window from ever being fully deallocated.
2024-12-30 13:45:14 -08:00
Mitchell Hashimoto
f8c3dc1bbf fix: quick terminal focus-follows-mouse behaviour (#3814)
# Description

Quick Terminal now focuses on the surface under the mouse pointer when
`focus-follows-mouse` is enabled.

Fixes #3337
2024-12-30 11:10:38 -08:00
Damien Mehala
ade07c4c3c fix: quick terminal focus-follows-mouse behaviour
Quick Terminal now focuses on the surface under the mouse
pointer when `focus-follows-mouse` is enabled.

Fixes #3337
2024-12-30 11:04:21 -08:00
Mitchell Hashimoto
68318e2830 Set alpha component for fullscreen background colour (#3834)
This fixes a bug in the fullscreen behaviour on MacOS.

As per discussion #2840 native fullscreen on MacOS should set the
background to be opaque. Colours are incorrectly set due to the alpha
channel.

## Original behaviour:
When windowed:
<img width="810" alt="Screenshot 2024-12-28 at 9 02 09 PM"
src="https://github.com/user-attachments/assets/59bd4380-2744-42e6-99c7-6d7b19919206"
/>

When fullscreened:
<img width="1470" alt="Screenshot 2024-12-28 at 9 01 46 PM"
src="https://github.com/user-attachments/assets/a18f82ea-8cce-4d9b-8bb2-c279e2a753f0"
/>

## After the fix:
When fullscreened:
<img width="1470" alt="Screenshot 2024-12-28 at 9 13 17 PM"
src="https://github.com/user-attachments/assets/6c3f31ae-c206-4234-8bde-1886ce16c837"
/>
2024-12-30 10:55:48 -08:00
Mitchell Hashimoto
716848cb58 macos: always have terminal fullscreen style (#3831)
~~When processing toggle_fullscreen actions, multiple FullscreenStyle
derived objects would register observers on the same window and
subsequently remove them when the old style was deinited.~~

~~This change passes ownership of the fullscreenNotification observers
to TerminalController while still allowing FullscreenStyles access to
the window for style specific actions.~~

We need to have at least one fullscreen style (even if it is not being
used) to make sure that observers for fullscreen state changes are set
up. An alternative approach would be the first version of this PR (for
which my reasoning was wrong but the end change was correct) which
registers the fullscreen observers at either the TerminalController or
BaseTerminalController level.

Fixes #3553
2024-12-30 08:56:19 -08:00
Damien Mehala
011c17da41 fix: quick terminal CPU spikes
Fixes #3998
2024-12-30 07:24:35 -08:00
Mitchell Hashimoto
37c5f5a123 macos: Help menu goes to website docs 2024-12-29 19:27:22 -08:00
Caleb Norton
8607b1f844 macos: correctly save terminal fullscreen style 2024-12-29 21:24:48 -06:00
Jon Parise
074edd3065 macos: disable auto-updates for local builds
The auto-update prompt isn't useful for local (source) builds. Disable
it by default by setting Sparkle's SUEnableAutomaticChecks Info.plist
key to NO (false) for all build configurations.

We then selectively re-enable it by deleting that Info.plist key from
our release workflows. We delete the key instead of setting its value to
YES (true) to give us Sparkle's default behavior of prompting the user
to enable update checks on the second application launch. (YES tells
Sparkle to skip that prompt and silently enable update checks.)

See also: https://sparkle-project.org/documentation/customization/
2024-12-29 15:48:59 -05:00
Mitchell Hashimoto
6508fec945 Revert "macos: disable auto-updates for local (source) builds (#3273)"
This reverts commit b39850fd8b463f78c6fb450cd7a59e43bdf4b622, reversing
changes made to 64ea3a1a29677ca5f094f8058c40c549bb741bc5.
2024-12-29 09:22:54 -08:00
Mitchell Hashimoto
b39850fd8b macos: disable auto-updates for local (source) builds (#3273)
The auto-update prompt isn't useful for local (source) builds so disable
both update checks and automatic downloads for the Debug and Release
configurations.

Fixes #3179
2024-12-29 09:20:07 -08:00
Zein Hajj-Ali
fa83140585 Set alpha component for fullscreen background colour 2024-12-28 21:07:43 -05:00
Mitchell Hashimoto
e2aee7f75b Handle an empty path to mean no pwd (#3399)
Fixes #3398
2024-12-27 11:55:36 -08:00
Daniel Patterson
8cbf8d5003 Fix broken macOS changes 2024-12-27 16:16:30 +00:00
Daniel Patterson
a4daabb28a Rename goto_split top/bottom directions to up/down. 2024-12-27 14:56:48 +00:00
Jon Parise
2c3847c9af macos: disable Sparkle checks in Debug and Release
This approach uses Xcode's Info.plist preprocessing to conditionally set
`SUEnableAutomaticChecks=false` for the Debug and Release build schemes.
It is unset for the ReleaseLocal scheme.

When this Info.plist key is explicitly set to false (as it is for these
build schemes), we disable auto-updates at runtime. Otherwise, we apply
the behavior defined by our "auto-update" configuration.
2024-12-27 08:16:18 -05:00
David Leadbeater
9db02fd152 Handle an empty path to mean no pwd
Fixes #3398
2024-12-28 00:09:05 +11:00
Jon Parise
f7a461a85f macos: disable auto-updates for local (source) builds
The auto-update prompt isn't useful for local (source) builds so disable
both update checks and automatic downloads.

There are multiple ways we could check if we've been built for source,
but the easiest and least intrusive approach is to check the value of
the 'GhosttyCommit' Info.plist key. Because it is only set as part of
the release build process, an empty key implies that we've been build
from source.
2024-12-27 07:36:14 -05:00