-
-
Notifications
You must be signed in to change notification settings - Fork 647
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
Should commands that are no-ops return a non-zero exit code? #187
Comments
Just another confirmation that the swap command with the window itself returns the exit code 0:
The original intention was if swapping 'fails' the last swap is repeated. |
I think this makes sense for swap and warp commands, but not necessarily for focus commands as they have a potential sideeffect of raising the window, as mentioned in the original post. I'll probably do an overhaul of the exit codes for all commands when I have time. My focus is currently on making the current functionality more robust, and to make sure the interface is good and clean, before looking at adding any kinds of major new functionality. |
This would be really helpful for "resize" as well (for BSP layouts). I'm a BSPWM user trying to replicate my setup, and I'm really fond of being able to fallback when resizing. For instance I have hotkeys that will grow the window to the right, but if it can't (i.e. it's against the edge) fall back to shrinking from the left. Without this there's no way to have a hotkey that always grows/shrinks a window. |
I have set an alternate key binding for shrinking (meh + jikl) and growing (hyper + jikl) in BSP layout. It works well and avoids this particular case of the non-zero exit code. Yabai won't be able to be a direct replication of BSP - it is absolutely a lifesaver as a legitimate twm for macOS which we otherwise wouldn't have. |
window swap, warp, insertion, grid, move, resize, and ratio, space balance, mirror, rotate, set padding, set gap, toggle padding and toggle gap, will now also report a non-zero exit code upon failure. |
Discussion
This was brought up by @kiryph in #186 (comment).
I am really unsure about this and want to discuss a possible change here.
This affects the focus, swap and warp commands. Note that the focus command can also be used for its side-effect of raising an already focused window that was not raised (e.g. from ffm set to autofocus), so it's not really a no-op sometimes.
The text was updated successfully, but these errors were encountered: