Skip to content

Ghostty quick-terminal swaps window on current screen with Ghossty app when Ghossty app not first #2615

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

Open
ixpict opened this issue May 2, 2025 · 3 comments

Comments

@ixpict
Copy link

ixpict commented May 2, 2025

I am using Ghostty and have added the recommended rules, but when I call Quick-Terminal, sometimes the arrangement of the current window changes.

Current rules:

yabai -m rule --add app="Ghostty" subrole="AXFloatingWindow" manage=off
yabai -m signal --add app='^Ghostty$' event=window_created action='yabai -m space --layout bsp'
yabai -m signal --add app='^Ghostty$' event=window_destroyed action='yabai -m space --layout bsp'

The rules for the popup window with the AXFloatingWindow subrole don't seem to be working, do they?

Here is the description of the Ghostty window for the quick terminal.

[{
        "id":2568,
        "pid":20940,
        "app":"Ghostty",
        "title":"~",
        "scratchpad":"",
        "frame":{
                "x":0.0000,
                "y":0.0000,
                "w":5120.0000,
                "h":540.0000
        },
        "role":"AXWindow",
        "subrole":"AXFloatingWindow",
        "root-window":true,
        "display":1,
        "space":2,
        "level":3,
        "sub-level":0,
        "layer":"above",
        "sub-layer":"normal",
        "opacity":1.0000,
        "split-type":"none",
        "split-child":"none",
        "stack-index":0,
        "can-move":true,
        "can-resize":true,
        "has-focus":true,
        "has-shadow":true,
        "has-parent-zoom":false,
        "has-fullscreen-zoom":false,
        "has-ax-reference":true,
        "is-native-fullscreen":false,
        "is-visible":true,
        "is-minimized":false,
        "is-hidden":false,
        "is-floating":true,
        "is-sticky":true,
        "is-grabbed":false
}
yabai --version
yabai-v7.1.14

macos version: 15.4.1
Ghostty 1.1.3

How to reproduce:

  1. Run two windows: Ghostty and any another app
  2. Change another app position to left (in Horizontal split)
  3. Press Quick terminal shortcut (example: Ctrl+` : keybind = global:ctrl+grave_accent=toggle_quick_terminal)
  4. Current windows swapped - Ghostty moved to left
@ixpict ixpict changed the title Ghostty quick-terminal swaps window on primary screen Ghostty quick-terminal swaps window on current screen May 2, 2025
@ixpict ixpict changed the title Ghostty quick-terminal swaps window on current screen Ghostty quick-terminal swaps window on current screen with Ghossty app when Ghossty app not first May 2, 2025
@ixpict
Copy link
Author

ixpict commented May 2, 2025

Oh! It seems I've got it, the issue is actually with the hotfix for tab problems from Ghostty. The event for creating a window triggers -m space --layout bsp, and this rearranges the window layout. But without it, there are strange window behaviours when creating tabs in this terminal.

Well, adding subrole="AXStandardWindow" doesn't solve the problem.

yabai -m signal --add app='^Ghostty$' subrole="AXStandardWindow" event=window_created action='yabai -m space --layout bsp'
yabai -m signal --add app='^Ghostty$' subrole="AXStandardWindow" event=window_destroyed action='yabai -m space --layout bsp'

Could you suggest where to dig further or how best to report the bug to Ghostty dev?

I apologise for not checking right away.

@ixpict
Copy link
Author

ixpict commented May 2, 2025

I found this issues, but it's seem macos problem?

ghostty-org/ghostty#4329
ghostty-org/ghostty#3254
ghostty-org/ghostty#5836
ghostty-org/ghostty#5934

@ldelossa
Copy link

Yeah, for the most part, this is a WON'T FIX.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants