Re: top: Fill last character in process line

2020-06-04 Thread lists
Wed, 3 Jun 2020 20:25:27 +0200 Klemens Nanni > On Wed, Jun 03, 2020 at 05:33:24PM +0100, Nicholas Marriott wrote: > > Actually I've got them the wrong way round here, but others have already > > explained them anyway :-). > Yup, which is why I will simply drop the diff: way too much hassle for

Re: top: Fill last character in process line

2020-06-03 Thread Klemens Nanni
On Wed, Jun 03, 2020 at 05:33:24PM +0100, Nicholas Marriott wrote: > Actually I've got them the wrong way round here, but others have already > explained them anyway :-). Yup, which is why I will simply drop the diff: way too much hassle for single column of output, let alone potential breakages o

Re: top: Fill last character in process line

2020-06-03 Thread Nicholas Marriott
Actually I've got them the wrong way round here, but others have already explained them anyway :-). On Wed, Jun 03, 2020 at 05:04:43PM +0100, Nicholas Marriott wrote: > xenl (xm) only matters for the last line - you can't write into the very > bottom right position without causing the terminal t

Re: top: Fill last character in process line

2020-06-03 Thread Nicholas Marriott
xenl (xm) only matters for the last line - you can't write into the very bottom right position without causing the terminal to scroll. No xenl is a pain and most applications solve it by just leaving that position always empty. The only terminal still about without xenl that I am aware of is the Ne

Re: top: Fill last character in process line

2020-06-03 Thread Theo de Raadt
Stuart Henderson wrote: > On 2020/06/03 14:49, Klemens Nanni wrote: > > On Wed, Jun 03, 2020 at 12:45:35PM +0100, Stuart Henderson wrote: > > > 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

Re: top: Fill last character in process line

2020-06-03 Thread Steffen Nurpmeso
Klemens Nanni wrote in <20200603124948.irvdnxrxa5g75pmi@eru>: |On Wed, Jun 03, 2020 at 12:45:35PM +0100, Stuart Henderson wrote: |> 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

Re: top: Fill last character in process line

2020-06-03 Thread Stuart Henderson
On 2020/06/03 14:49, Klemens Nanni wrote: > On Wed, Jun 03, 2020 at 12:45:35PM +0100, Stuart Henderson wrote: > > 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 cir

Re: top: Fill last character in process line

2020-06-03 Thread Klemens Nanni
On Wed, Jun 03, 2020 at 12:45:35PM +0100, Stuart Henderson wrote: > 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

Re: top: Fill last character in process line

2020-06-03 Thread Stuart Henderson
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

Re: top: Fill last character in process line

2020-06-03 Thread Klemens Nanni
On Wed, Jun 03, 2020 at 01:11:15PM +0200, Mark Kettenis wrote: > Does that write into the last column of a 80-character wide screen? > That causes a linewrap on some terminals isn't it? And that would be > undesirable. Yes, it does; xterm and st from the x11/st package have no problem however to

Re: top: Fill last character in process line

2020-06-03 Thread Mark Kettenis
> Date: Wed, 3 Jun 2020 12:46:48 +0200 > From: Klemens Nanni > > 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

top: Fill last character in process line

2020-06-03 Thread Klemens Nanni
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 th