-
-
Notifications
You must be signed in to change notification settings - Fork 658
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
[bug] serialization of --windows sometimes yields invalid json #2533
Comments
Hm I can't reproduce this issue using software such as Safari, Orion, Kitty. What do you use to get information about the so called "ghost window" that is still there? The trailing comma would likely be because https://github.com/koekeishiya/yabai/blob/master/src/window_manager.c#L48 |
I am not familiar with systems programming nor the macOS APIs you use in yabai, therefore I can only speculate and experiment. So far I was able to reproduce the error with Slack on two separate machines, an Intel iMac and an M2 Macbook. Here's a short demo: demo.mp4I first thought the issue could stem from Electron, but a test with Obsidian did not result in the same error. Another observation that might be interesting is the following: |
If you enable debug output (either through the config file
I'd prefer not to have to install Slack or Teams on my private machine, but maybe I'll have to do so. I do have a way to fix the json output, but I'd like to figure out what is actually the root cause instead of patching something I don't exactly understand. |
The following is a sequence from the debug output which roughly corresponds to the order of operations shown in the demo above
I have noticed that some events seem to be logged twice or even three times when in reality there should only be one of them.
|
Just want to add that I have this issue and I've seen both the trailing comma at the end of a list and also a double comma, suggesting that it is indeed null values resolving to empty strings. |
Can you downgrade to v7.1.6 and do the same exact steps. Instead of getting trailing commas you should instead get window output where |
ran into this issue, where there are
Confirmed w/ 7.1.8,
|
Can you post more of the query output information, maybe such as layer/sub-layer and level/sub-level? |
full output of [
{
"id": 3038,
"pid": 41263,
"app": "1Password",
"title": "Quick Access — 1Password",
"scratchpad": "",
"frame": {
"x": 625.0000,
"y": 277.0000,
"w": 550.0000,
"h": 108.0000
},
"role": "",
"subrole": "",
"root-window": true,
"display": 1,
"space": 1,
"level": 101,
"sub-level": 0,
"layer": "unknown",
"sub-layer": "normal",
"opacity": 1.0000,
"split-type": "none",
"split-child": "none",
"stack-index": 0,
"can-move": false,
"can-resize": false,
"has-focus": false,
"has-shadow": true,
"has-parent-zoom": false,
"has-fullscreen-zoom": false,
"has-ax-reference": false,
"is-native-fullscreen": false,
"is-visible": false,
"is-minimized": false,
"is-hidden": false,
"is-floating": false,
"is-sticky": false,
"is-grabbed": false
}
]
no scripting addition/sip enabled |
Can you try the latest master? |
thanks for the quick fix, latest master solved it in my case |
yabai-v7.1.8
In yesterdays update a bug was introduced where
yabai -m query --windows
could return an array with a trailing comma, which is invalid and cannot be properly parsed by e.g.jq
.EDIT: After some testing I found that
yabai -m query --windows --space 1
was valid, butyabai -m query --windows --space 2
had the trailing comma. I closed all apps that had windows in space 2 and reopened them, after that the problem was fixed.EDIT2: I have found a way to reproduce the issue. If I close a window of an App that continues to run with 0 windows, the space seems to have this "ghost window" still in its state and that results in the trailing comma. This way, one can get multiple trailing commas too. Re-opening the window by clicking on the App icon resolves the bug. Reproduced in Slack and Teams.
The text was updated successfully, but these errors were encountered: