Files
kq 3898f34c5a fix(messages): spurious newline with --headless + cmdheight=0 #38494
Problem:
When running nvim in headless mode with `cmdheight=0`, an extra newline
is prepended to output (eg. `nvim --clean --cmd 'set cmdheight=0'
--headless -c 'echo 1 | q' ` prints `\n1` instead of `1`), because
`!ui_has(kUIMessages)` is always true in headless mode, causing `p_ch ==
0` in `msg_start()` to unconditionally trigger `msg_putchar('\n')` which
writes a newline to stdout.

Solution:
When in headless printf mode with `p_ch == 0` and no prior output on the
current line, call `msg_puts_display("\n", ...)` directly instead of
`msg_putchar('\n')`, so the grid is still updated for correct screen
positioning but no newline is written to stdout.
2026-03-27 07:08:32 -04:00
..