Skip to content

Conversation

@zsugabubus
Copy link

If input is not being read until EAGAIN, we will not get informed
(signaled) when further input arrives.

Fixes #422.

If input is not being read until `EAGAIN`, we will not get informed
(signaled) when further input arrives.
vivien added a commit that referenced this pull request Jan 13, 2023
i3blocks currently wrongly assumes that a persistent program will
be line buffered (or act as such) and flush one line at a time. In
this common scenario, it is safe to read a single line per signal,
but there are cases where this behavior is not not wanted.

For example, a program may print several lines at once, resulting in
updating only the first line, while filling up the pipe and eventually
have the block program hang on the next write operation.

To fix this, drain the pipe of a persistent block upon reception of
a signal, but line by line to avoid breaking non JSON blocks.

Also make sure to update a block only after having successfully read
its output, to avoid resetting a block on error such as on incomplete
line, or when the pipe was already flushed.

Closes #422
Refs #425
dllud pushed a commit to dllud/i3blocks that referenced this pull request Jan 12, 2024
dunst: update documentation to reflect 99725fb
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

Successfully merging this pull request may close these issues.

xtitle -s hangs from time to time

1 participant