On 2020/06/03 12:46, Klemens Nanni wrote:
>     
> i_process() prints process lines from the global buffer thisline[MAX_COLS]
> which is filed by format_next_process() using snprintf(3), i.e. it is
> guaranteed to be NUL terminated.
>     
> display_width is always set to screen_width and capped to MAX_COLS-1
> in display_resize(), so NUL terminating thisline[] at index
> display_width is not only redundant but also cuts off the last visibile
> character for each process line.
>     
> Remove this redundancy to make top use the entire line and not have
> process names (or arguments) end one char too early in interactive use.
> 
> Feedback? OK?

It should check terminal capabilities for this, see termcap(5).
If 'am' (auto-margin) is set then it shouldn't write to the final column.
If 'xn' is set then it's OK in some circumstances (it's probably easier to
skip writing to the final column if this is set too).

Reply via email to