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

Improve parsing of key-value pairs; don't use strtok #307

Closed
koekeishiya opened this issue Nov 9, 2019 · 0 comments
Closed

Improve parsing of key-value pairs; don't use strtok #307

koekeishiya opened this issue Nov 9, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@koekeishiya
Copy link
Owner

koekeishiya commented Nov 9, 2019

Pulled from #174

@dominiklohmann I feel like I'm doing something horribly wrong, because my action works when executed from a file but not when inline (re: confusion in #177 / from #167). Maybe you know what's up here.

yabai -m signal --add event=application_launched label=test action="yabai -m query --windows | jq -r '.[] | select(.pid | tostring == env.YABAI_PROCESS_ID)'"
# fails with this is on stdout
# sh: -c: line 0: unexpected EOF while looking for matching `''
# sh: -c: line 1: syntax error: unexpected end of file

# this works
export YABAI_PROCESS_ID=19210 && yabai -m query --windows | jq -r '.[] | select(.pid | tostring == env.YABAI_PROCESS_ID)'

# this works as well
/usr/bin/env YABAI_PROCESS_ID=19210 sh -c "yabai -m query --windows | jq -r '.[] | select(.pid | tostring == env.YABAI_PROCESS_ID)'"
@koekeishiya koekeishiya added the bug Something isn't working label Nov 9, 2019
@koekeishiya koekeishiya added the addressed on master; not released Fixed upstream, but not yet released label Nov 9, 2019
@koekeishiya koekeishiya changed the title Improve parsing of key-value pairs instead of using strtok Improve parsing of key-value pairs; don't use strtok Nov 9, 2019
@koekeishiya koekeishiya removed the addressed on master; not released Fixed upstream, but not yet released label Nov 9, 2019
brorbw pushed a commit to brorbw/yabai that referenced this issue Jan 28, 2020
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

1 participant