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

Config file executable not resolved correctly if the path contains whitespace #2562

Open
gouvinb opened this issue Feb 26, 2025 · 1 comment

Comments

@gouvinb
Copy link

gouvinb commented Feb 26, 2025

Context

  • In my environment, XDG_CONFIG_HOME is equal to ~/Library/Application Support.
  • The location of the yabairc file is ~/Library/Application Support/yabai/yabairc.

Setting the scene

When yabairc is executable, then when starting the service with the command yabai --start-service, my configuration is not loaded and the error logs show me:

sh: /Users/gouvinb/Library/Application: Permission denied
sh: /Users/gouvinb/Library/Application: Permission denied
sh: /Users/gouvinb/Library/Application: Permission denied

But if yabairc is not executable then my configuration is correctly loaded.

I think the error is here.

But I can't explain why env -c operates like this.

@koekeishiya
Copy link
Owner

koekeishiya commented Mar 9, 2025

I think the whitespace is supposed to be escaped within the XDG_CONFIG_HOME value. So ~/Library/Application Support should be ~/Library/Application\ Support.

The only way I can think of for yabai to fix it would be to enclose the full path (or partial path tarversal) within ' before forwarding it to env -c, but I don't think that is the correct thing to do. I suppose doing a pre-pass to escape whitespaces would be more acceptable.

If I am wrong and you are aware of some specification for this behaviour feel free to reference it and/or any standardized solution that other software implementing support for XDG_CONFIG_HOME uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants