Skip to content

fix: line-buffer stdout so print() reaches redirected logs#631

Merged
JimmyCozza merged 1 commit into
mainfrom
fix/print-stdout-buffering-main
Jul 7, 2026
Merged

fix: line-buffer stdout so print() reaches redirected logs#631
JimmyCozza merged 1 commit into
mainfrom
fix/print-stdout-buffering-main

Conversation

@JimmyCozza

Copy link
Copy Markdown
Contributor

Description

print() writes to stdout, which glibc block-buffers when stdout isn't a TTY (somewm-client test, a pipe, journald), so it never flushes while the compositor runs. Line-buffer stdout at startup.

Forward-port of #630 (release/1.4). Fixes #622.

Test Plan

Checklist

  • Lua libraries not modified — C-only change (somewm.c)
  • Tests pass — unit unaffected (C-only); one pre-existing, unrelated menubar icon-path failure on main

rc.lua print() writes to stdout, which glibc block-buffers when stdout is not
a TTY (somewm-client test, a pipe to tee, journald), so the output never
flushed while the compositor ran. Set stdout line-buffered at startup; stderr
is already unbuffered.
@JimmyCozza JimmyCozza merged commit bd232b1 into main Jul 7, 2026
3 checks passed
@JimmyCozza JimmyCozza deleted the fix/print-stdout-buffering-main branch July 7, 2026 14:44
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.

Output from print() is not displayed when running via somewm-client test

1 participant