Skip to content

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

@tellezhector

Description

@tellezhector

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions