Issue: Moving to a display with an empty space - could not locate a window below the cursor
- Dominant language
- C
- Stars
- 29.6k
- Forks
- 758
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Thanks for making Yabai, its an awesome application!
My issue is the following:
`yabai -m display --focus ` fails with `could not locate a window below the cursor.` when the target display/space has no windows (empty space). This makes it hard to reliably focus displays in scripts on a multi-monitor setup.
## Environment
- macOS: Tahoe 26.2
- yabai: v7.1.16
- SIP: disabled
- yabai mode: Scripting additions enabled
- Displays: 3 monitors
- Spaces: 3 spaces per display.
- Mission Control settings:
- Displays have separate Spaces: on
- mouse_follows_focus: Enabled
## What I’m trying to do
To illustrate the issue I simply run a terminal command to focus a specific display when the currently-visible space on that display is empty:
```sh
> yabai -m display --focus 2
could not locate a window below the cursor.
```
Any suggestions are appreciated.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing `yabai -m display --focus 2` with three monitors and an empty target space under macOS Tahoe 26.2, with mouse_follows_focus enabled and scripting additions enabled. Investigate how display focus handles an empty space; done means focusing the requested display succeeds without the `could not locate a window below the cursor` error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, macos
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100