Re: [PATCH v10] perf test: Truncate printed test descriptions dynamically to avoid terminal wrapping
From: Arnaldo Carvalho de Melo
Date: Thu Jun 11 2026 - 11:12:05 EST
On Thu, Jun 04, 2026 at 03:06:27PM -0700, Ian Rogers wrote:
> When test descriptions are extremely long (e.g., the truncated perf.data
> graceful handling test is 103 characters long), they wrap across terminal
> boundaries.
>
> Because the ANSI escape code to delete the line (PERF_COLOR_DELETE_LINE)
> only clears a single terminal line, visual wrapping leaves orphan
> wrapped lines on the screen, which results in the test description being
> printed multiple times.
>
> Resolve this by checking the terminal width (get_term_dimensions) and
> dynamically truncating the printed test description to fit within the
> available columns, leaving safety space for the prefix index and status
> suffix.
Thanks, applied to perf-tools-next, for v7.2.
- Arnaldo