Skip to content
Latchkey

What Is Line Buffering?

Line buffering is an output mode that holds written characters in a buffer and flushes them whenever a newline is emitted. It is a middle ground between unbuffered output and large block buffering, giving timely line-by-line visibility. Many programs use it automatically when their output goes to a terminal but switch to block buffering when it goes to a pipe or file.

Why it matters

The terminal-versus-pipe difference is exactly why CI logs, which capture piped output, often lag or arrive in bursts. Forcing line buffering restores the real-time, line-by-line logs you would see interactively.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →