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

Malformed json stdin string on click events when interval=persist is set #491

Open
tellezhector opened this issue Nov 25, 2024 · 0 comments

Comments

@tellezhector
Copy link

If you pass an stdout like:

{"key":"{value}"}

(note that the value is a string of 7 chars {value}),

next time you have a click event, stdin will receive the text:

{"key":{value}}

Which is improper json (note that the second pair of double quotes has disappeared).

This only seems to happen when the stdout involved is a string whose first and last characters are a paired curly braces, that is the last character is properly paired with the first, If you where to send to stdout the string {"key":"{value}}"}, on next click you would receive the string {"key":"{value}}"} (which is proper json).

Unfortunately I am not well versed in i3blocks' programming language, from following the source, I can point to two possible culprits:

  1. json_escape (which gets called from block_send_key and block_send_json in turn)

  2. or probably, the value is incorrectly passing the test json_is_valid (called from block_send_key).

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

1 participant