Re: patch: make sdiff tty-aware

2019-12-12 Thread Stuart Henderson
On 2019/12/12 10:47, Marc Espie wrote: > Well, in the sysmerge use-case, you see the first line showing the > $OpenBSD$ prompt usually. That's often when you realize your terminal is > really small, and you will miss the next lines. The $OpenBSD$ line is > reasonably unambiguous, as the rev number

Re: patch: make sdiff tty-aware

2019-12-12 Thread Theo de Raadt
I think the diff should do only one thing: -w width Print a maximum of width characters on each line. The default is 130 characters. At startup, do the ioctl to get the width. If -w is specified, it overrides thae value. And delete the sentence about 130 from the

Re: patch: make sdiff tty-aware

2019-12-12 Thread Marc Espie
On Thu, Dec 12, 2019 at 02:51:18AM -0700, Theo de Raadt wrote: > Marc Espie wrote: > > > On Wed, Dec 11, 2019 at 01:15:40PM -0700, Theo de Raadt wrote: > > > I'm not sure I understand the goal of the signal handler. > > > > > > sdiff is moving forward through the file, only. If you are in a pag

Re: patch: make sdiff tty-aware

2019-12-12 Thread Theo de Raadt
Marc Espie wrote: > On Wed, Dec 11, 2019 at 01:15:40PM -0700, Theo de Raadt wrote: > > I'm not sure I understand the goal of the signal handler. > > > > sdiff is moving forward through the file, only. If you are in a pager, > > you want to increase the width for the later output not yet visible

Re: patch: make sdiff tty-aware

2019-12-12 Thread Marc Espie
On Wed, Dec 11, 2019 at 01:15:40PM -0700, Theo de Raadt wrote: > I'm not sure I understand the goal of the signal handler. > > sdiff is moving forward through the file, only. If you are in a pager, > you want to increase the width for the later output not yet visible? > the normal way one does th

Re: patch: make sdiff tty-aware

2019-12-11 Thread Theo de Raadt
I'm not sure I understand the goal of the signal handler. sdiff is moving forward through the file, only. If you are in a pager, you want to increase the width for the later output not yet visible? the normal way one does that in programs which don't backtrack and re-output, is by restarting the

patch: make sdiff tty-aware

2019-12-11 Thread Marc Espie
This patch allows sdiff to auto-detect tty width, by passing -w auto More importantly, sdiff will adjust its variables on the fly for subsequent lines (I don't know if redrawing the current lines when the tty changes is advisable). It's pretty straightforward, tested thru sysmerge. Doesn't seem