summaryrefslogtreecommitdiff
path: root/macos/Sources/Features/QuickTerminal/QuickTerminalController.swift
AgeCommit message (Collapse)Author
2025-10-08macOS: only show the update overlay if window doesn't support itMitchell Hashimoto
2025-09-30docshimura467
2025-09-30refactor: no need to set from for moveFocus probablyhimura467
2025-09-29refactor: improve asynchronous delay by delegating window/app activation ↵himura467
process to animateIn
2025-09-29feat: focusSurface for quick terminalhimura467
2025-09-19macos: quick terminal stores the last closed size by screenMitchell Hashimoto
Fixes #8713 This stores the last closed state of the quick terminal by screen pointer. We use a weak mapping so if a screen is unplugged we'll clear the memory. We will not remember the size if you unplug and replug in a monitor.
2025-08-26macos: fix quick terminal issue where closing while fullscreen Mitchell Hashimoto
2025-08-26macos: style changes for quick terminal sizingMitchell Hashimoto
2025-08-26macOS: enable quick terminal manual resizingFriedrich Stoltzfus
You can now resize the quick terminal both vertically and horizontally. To incorporate adjusting the custom secondary size on the quick terminal we needed to have the ability to resize the width (if from top, bottom, or center), and height (if from right, left, or center). The quick terminal will retain the user's manually adjusted size while the app is open. A new feature with this is that when the secondary size is adjusted (or primary if the quick terminal is center), the size will increase or decrease on both sides of the terminal.
2025-08-26macOS: Add support for quick terminal sizing configurationFriedrich Stoltzfus
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-22typo found typos, typo may keep themTobias Pape
2025-08-22Work around strange SwiftUI behavior in "older" macOSen.Tobias Pape
The Quick Terminal would not appear anymore, as somewhere in the framework the Quick Terminal Window's geometry gets corrupted when the window is added to the UI. This works around by caching the windows geometry and reusing it afterwards
2025-06-21macos: intent to open quick terminalMitchell Hashimoto
2025-06-21macos: Close Terminal IntentMitchell Hashimoto
2025-06-07macos: show quick terminal on undo/redoMitchell Hashimoto
2025-06-07macos: address quick terminal basic functionality with new APIMitchell Hashimoto
2025-06-07macos: quick terminal restores previous size when exiting final surfaceMitchell Hashimoto
This fixes a regression from the new split work last week, but it was also probably an issue before that in a slightly different way. With the new split work, the quick terminal was becoming unusable when the final surface explicitly `exit`-ed, because AppKit/SwiftUI would resize the window to a very small size and you couldn't see the new terminal on the next toggle. Prior to this, I think the quick terminal would've reverted to its original size but I'm not sure (even if the user resized it manually). This commit saves the size of the quick terminal at the point all surfaces are exited and restores it when the quick terminal is shown the next time with a new initial surface.
2025-06-05macos: rename surfaceTree2 to surfaceTreeMitchell Hashimoto
2025-06-05macos: Remove the legacy SurfaceTreeMitchell Hashimoto
2025-06-05macos: handle surfaceTreeDidChangeMitchell Hashimoto
2025-04-15macos: quick terminal uses padded notch mode if notch is visibleMitchell Hashimoto
Fixes #6612
2025-04-14macOS: quick terminal should retain menu if not frontmostMitchell Hashimoto
This is a bug I noticed in the following scenario: 1. Open Ghostty 2. Fullscreen normal terminal window (native fullscreen) 3. Open quick terminal 4. Move spaces, QT follows 5. Fullscreen the quick terminal The result was that the menu bar would not disappear since our app is not frontmost but we set the fullscreen frame such that we expected it.
2025-04-14macOS: non-native fullscreen should not hide menu on fullscreen spaceMitchell Hashimoto
Fixes #7075 We have to use private APIs for this, I couldn't find a reliable way otherwise.
2025-02-28Fix Terminal Inspector option turns inactive if toggled in the Quick ↵Mitchell Hashimoto
Terminal (#6024) Fixed: [2475](https://github.com/ghostty-org/ghostty/issues/2475) The problem actually existed because of the responder chain, as previously pointed out in the report (thanks to @mitchellh). When we first click on Toggle Terminal Inspector: * the responder chain goes to _toggleTerminalInspector_ (_SurfaceView_AppKit_ implementation). When we click the second toggleTerminalInspector: * it tries to find the next responder, but the one available is _TerminalController_. (if we remove this method from there, the bug will reproduce even without quick mode) **Problem**: TerminalController not available during quick terminal, so there's no way to toggle inspector **Solution**: We add toggleTerminalInspector to the _QuickTerminalController_: selector, as we did with other similar methods.
2025-02-28Fix Terminal Inspector option turns inactive if toggled in the Quick TerminalMikhail Borisov
2025-02-25fix(macos): make showNoNewTabAlert method private #5939McNight
2025-02-25fix(macos): address MR feedback #5939McNight
2025-02-23fix(macos): prevent performing newTab shortcut on QuickTerminalWindow #5939McNight
2025-01-24macos: hide dock globally if the dock conflictsMitchell Hashimoto
Related to #5361 The fix in 5361 wasn't sufficient since it only applied if our app was in the foreground. Our quick terminal is a non-activating NSPanel to allow it to work on any space (fullscreen included). This means that Ghostty doesn't become the active app when the quick terminal is shown and another app is in the foreground. To work around this, we now hide the dock globally when the quick terminal is shown AND the dock is in a conflicting position. We restore this state when the quick terminal is hidden, loses focus, or Ghostty is quit.
2025-01-24macos: autohide dock if quick terminal would conflict with itMitchell Hashimoto
Fixes #5328 The dock sits above the level of the quick terminal, and the quick terminal frame typical includes the dock. Hence, if the dock is visible and the quick terminal would conflict with it, then part of the terminal is obscured. This commit makes the dock autohide if the quick terminal would conflict with it. The autohide is disabled when the quick terminal is closed. We can't set our window level above the dock, as this would prevent things such as input methods from rendering properly in the quick terminal window. iTerm2 (the only other macOS terminal I know of that supports a dropdown mode) frames the terminal around the dock. I think this looks less aesthetically pleasing and I prefer autohiding the dock instead. We can introduce a setting to change this behavior if desired later. Additionally, this commit introduces a mechanism to safely set app-global presentation options from multiple sources without stepping on each other.
2025-01-13Metal: blend in Display P3 color space, add option for linear blendingQwerasd
This commit is quite large because it's fairly interconnected and can't be split up in a logical way. The main part of this commit is that alpha blending is now always done in the Display P3 color space, and depending on the configured `window-colorspace` colors will be converted from sRGB or assumed to already be Display P3 colors. In addition, a config option `text-blending` has been added which allows the user to configure linear blending (AKA "gamma correction"). Linear alpha blending also applies to images and makes custom shaders receive linear colors rather than sRGB. In addition, an experimental option has been added which corrects linear blending's tendency to make dark text look too thin and bright text look too thick. Essentially it's a correction curve on the alpha channel that depends on the luminance of the glyph being drawn.
2025-01-12macos: only set quick terminal level to popUpMenu during animationMitchell Hashimoto
Fixes #4999 We need to set the level to popUpMenu so that we can move the window offscreen and animate it over the main menu, but we must reset it back to floating after the animation is complete so that other higher-level windows can be shown on top of it such as IME windows.
2025-01-08macos: animate in even if remain on another spaceMitchell Hashimoto
2025-01-08misc cleanupsMitchell Hashimoto
2025-01-08Fix the issue that the quick term not shown on first callSoh Satoh
2025-01-08Move the quick terminal to active space if toggle() called while opening on ↵Soh Satoh
another space
2025-01-08Merge branch 'main' into show-quick-term-on-another-appSoh Satoh
2025-01-08Add quick-terminal-space-behavior optionSoh Satoh
2024-12-30fix: quick terminal CPU spikesDamien Mehala
Fixes #3998
2024-12-22config: quick terminal auto hideDamien MEHALA
Introduce a setting allowing to customize the behavior of the quick terminal when it loses focus. By default, the quick terminal will automatically hide. However, you can now configure it to remain open by setting `quick-terminal-autohide: false`. Resolves #2558
2024-12-01macos: trigger fullscreenDidChange on any fullscreen eventMitchell Hashimoto
Fixes #2840 Related to #2842 This builds on #2842 by missing a key situation: when native fullscreen is toggled using the menu bar items it doesn't go through our `FullscreenStyle` machinery so we don't trigger fullscreen change events. This commit makes it so that our FullscreenStyle always listens for native fullscreen change (even in non-native modes) to fire a fullscreen did change event. This way we can always rely on the event to be fired when fullscreen changes no matter what.
2024-11-21macos: change config access to evented, derived config like libghosttyMitchell Hashimoto
Previously, we would access the `ghostty.config` object from anywhere. The issue with this is that memory lifetime access to the underlying `ghostty_config_t` was messy. It was easy when the apprt owned every reference but since automatic theme changes were implemented, this isn't always true anymore. To fix this, we move to the same pattern we use internally in the core of ghostty: whenever the config changes, we handle an event, derive our desired values out of the config (copy them), and then let the caller free the config if they want to. This way, we can be sure that any information we need from the config is always owned by us.
2024-10-31macos: quick terminal set colorspaceMitchell Hashimoto
2024-10-31Revert "macos: setup colorspace in base terminal controller"Mitchell Hashimoto
This reverts commit e64b231248f68b2fd1e19d538d243b886d5284ff.
2024-10-30macos: setup colorspace in base terminal controllerMitchell Hashimoto
Fixes #2519 This sets up the colorspace for terminal windows in the base controller. This also modifies some of our logic so its easier for subclasses of base controllers to specify custom logic when the configuration reloads, since that's likely to be a common thing.
2024-10-25small renameMitchell Hashimoto
2024-10-25add quick-terminal-animate-duration optionPaul Miller
2024-10-23macos: use notification to detect when quick terminal shows/hidesMitchell Hashimoto
Fixes #2474
2024-10-09macos: retry focusing the quick terminal to handle focus on other screenMitchell Hashimoto
Fixes #2409 This is one of the weirder macOS quirks (bugs? who knows!) I've seen recently. The bug as described in #2409: when you have at least two monitors ("screens" in AppKit parlance), Ghostty on one, a focused app on the other, and you toggle the quick terminal, the quick terminal does not have focus. We already knew and accounted for the fact that `window.makeKeyAndOrderFront(nil)` does not work until the window is visible and on the target screen. To do this, we only called this once the animation was complete. For the same NSScreen, this works, but for another screen, it does not. Using one DispatchQueue.async tick also does not work. Based on testing, it takes anywhere from 2 to 5 ticks to get the window focus API to work properly. Okay. The solution I came up with here is to retry the focus operation every 25ms up to 250ms. This has worked consistently for me within the first 5 ticks but it is obviously a hack so I'm not sure if this is all right. This fixes the issue but if there's a better way to do this, I'm all ears!
2024-10-07macos: quick terminal window blur settings take effect properlyMitchell Hashimoto
Fixes #2410