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

Return an error for queries with invalid, named selectors #158

Closed
dominiklohmann opened this issue Jul 26, 2019 · 1 comment
Closed

Return an error for queries with invalid, named selectors #158

dominiklohmann opened this issue Jul 26, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@dominiklohmann
Copy link
Collaborator

Bug report

When querying with an invalid, named selector, yabai acts as if no selector was given at all and returns the focused window/space/display. When given a number instead of a string, yabai returns an error instead.

# returns an error

❯ yabai -m query --windows --window 0
could not locate the selected window.
❯ echo $?
1

# returns the focused window

❯ yabai -m query --window --window asdf
{ ... }
❯ echo $?
0

The behaviour should be consistent so that scripts can test whether a valid selector was provided.

# check if a valid display selector was provided by the user
if ! yabai -m query --displays --display "${1}" > /dev/null 2>&1; then
        >&2 echo "could not locate the selected display."
        exit 1
fi
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released bug Something isn't working labels Jul 28, 2019
@koekeishiya
Copy link
Owner

Fixed on master.

@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants