Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ghost-Windows on macOS with global toggle-visibility keybind. #3219

Closed
cpojer opened this issue Dec 27, 2024 · 8 comments · Fixed by #4128
Closed

Ghost-Windows on macOS with global toggle-visibility keybind. #3219

cpojer opened this issue Dec 27, 2024 · 8 comments · Fixed by #4128
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos
Milestone

Comments

@cpojer
Copy link

cpojer commented Dec 27, 2024

Thanks for building Ghostty. I'm trying to migrate from iTerm2 which has a "Show/hide all windows with a system-wide hotkey". Here is my current config:

command = /opt/homebrew/bin/fish
theme = Builtin Light
font-family = "Fira Code"
keybind = global:ctrl+y=toggle_visibility

Every time I toggle visibility, it creates a non-interactive "ghost window" behind the current window. Here, I'm toggling between iTerm and Ghostty by pressing ctrl+y:

CleanShot.2024-12-27.at.09.45.172.mp4

Separately, when visibility is hidden using this shortcut, clicking the Ghostty icon in the macOS dock does not show the Ghostty windows until triggering toggle visibility action again.

Next, pressing the toggle visibility button sometimes creates tons of empty windows:
Image

Finally, when Ghostty gets into this state, cmd+w may close the session but leaves a ghost window behind:
Image

I'm using the latest versions of everything on macOS.

@cpojer
Copy link
Author

cpojer commented Dec 27, 2024

Oh, and I forgot, if Ghostty is open but has no windows, it would be awesome if the toggle visibility action could create a new window.

@cpojer
Copy link
Author

cpojer commented Dec 27, 2024

cc @rolandpeelen re #2205.

@mitchellh mitchellh added os/macos needs-confirmation A reproduction has been reported, but the bug hasn't been confirmed or reproduced by a maintainer. gui GUI or app issue regardless of platform (i.e. Swift, GTK) labels Dec 27, 2024
@crabique
Copy link

Oh, and I forgot, if Ghostty is open but has no windows, it would be awesome if the toggle visibility action could create a new window.

There's also incompatibility with quit-after-last-window-closed=true, toggling the visibility off actually exits the program entirely.

@jaysonfrancis
Copy link

fwiw, i don't experience this when toggling only the default initial window at start up.

However, if i create a new window (cmd+n), close the initial one, I experience the same thing during toggle. Also if I create tabs (cmd+t) and toggle, the tabs come back as separate windows instead of tabs

(installed via brew, Sequoia 15.3)

@mitchellh mitchellh added this to the 1.0.1 milestone Dec 29, 2024
@ShaneK
Copy link

ShaneK commented Dec 30, 2024

Looks like even just opening a new tab with cmd+t on MacOS and then toggling the visibility causes this issue. It also splits the tabs and if you do it a couple of times they'll both be broken windows showing only their title bars

@mitchellh mitchellh removed the needs-confirmation A reproduction has been reported, but the bug hasn't been confirmed or reproduced by a maintainer. label Dec 30, 2024
mitchellh added a commit that referenced this issue Dec 30, 2024
…ers (#4128)

Fixes #3219

We were holding a reference cycle to the base terminal controller. This
was preventing the window from ever being fully deallocated.
@datanoise
Copy link

The last commit seems like fixes the 'ghost windows' issue, but toggle-visibility still splits tabs into separate windows.

@ShaneK
Copy link

ShaneK commented Dec 31, 2024

Yeah, I was thinking maybe that should be made its own issue. It probably is outside the scope of this one.

@jsardev
Copy link

jsardev commented Jan 1, 2025

I found there's a discussion regarding this already here: #4240

otherJL0 pushed a commit to otherJL0/ghostty that referenced this issue Jan 1, 2025
Fixes ghostty-org#3219

We were holding a reference cycle to the base terminal controller. This
was preventing the window from ever being fully deallocated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/macos
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants