diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a693f9..690b86cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] ### Changed - Update scripting-addition to support macOS Big Sur 11.0 Build 20A5384c [#589](https://github.com/koekeishiya/yabai/issues/589) +- Return a non-zero exit code when focusing a space fails due to an issue with the scripting-addition [#181](https://github.com/koekeishiya/yabai/issues/181) ## [3.3.0] - 2020-09-03 ### Added diff --git a/src/message.c b/src/message.c index f8f03e9f..f0be3068 100644 --- a/src/message.c +++ b/src/message.c @@ -1326,6 +1326,8 @@ static void handle_domain_space(FILE *rsp, struct token domain, char *message) daemon_fail(rsp, "cannot focus space because the display is in the middle of an animation.\n"); } else if (result == SPACE_OP_ERROR_IN_MISSION_CONTROL) { daemon_fail(rsp, "cannot focus space because mission-control is active.\n"); + } else { + daemon_fail(rsp, "cannot focus space due to an error with the scripting-addition.\n"); } } } else if (token_equals(command, COMMAND_SPACE_MOVE)) { diff --git a/src/space_manager.c b/src/space_manager.c index e4c42075..2f252dce 100644 --- a/src/space_manager.c +++ b/src/space_manager.c @@ -641,6 +641,8 @@ enum space_op_error space_manager_focus_space(uint64_t sid) if (scripting_addition_focus_space(sid)) { if (focus_display) display_manager_focus_display(new_did); + } else { + return SPACE_OP_ERROR_SCRIPTING_ADDITION; } return SPACE_OP_ERROR_SUCCESS; diff --git a/src/space_manager.h b/src/space_manager.h index 6bbcbafd..77e58d64 100644 --- a/src/space_manager.h +++ b/src/space_manager.h @@ -44,6 +44,7 @@ enum space_op_error SPACE_OP_ERROR_SAME_DISPLAY = 7, SPACE_OP_ERROR_DISPLAY_IS_ANIMATING = 8, SPACE_OP_ERROR_IN_MISSION_CONTROL = 9, + SPACE_OP_ERROR_SCRIPTING_ADDITION = 10, }; bool space_manager_has_separate_spaces(void);