Download raw body.
watch: tab + holizontal scroll
On 2025-06-27, Ted Unangst wrote:
> On 2025-06-27, YASUOKA Masahiko wrote:
> > Hi,
> >
> > More care about TAB spaces seems to be needed for scrolling
> > horizontally.
>
> This isn't quite right. I ran watch cat tabs.txt.
I think the fix is simple if we do it in child_input.
Does this work for you?
Index: watch.c
===================================================================
RCS file: /home/cvs/src/usr.bin/watch/watch.c,v
diff -u -p -r1.32 watch.c
--- watch.c 26 Jun 2025 21:34:45 -0000 1.32
+++ watch.c 27 Jun 2025 17:33:37 -0000
@@ -544,6 +544,13 @@ child_input(int sig, short event, void *
}
if (c == MAXCOLUMN)
continue;
+ if (wc == '\t') {
+ (*buf)[l][c++] = ' ';
+ while (c & 7 && c < MAXCOLUMN)
+ (*buf)[l][c++] = ' ';
+ continue;
+ }
+
(*buf)[l][c++] = wc;
}
display(buf, prev_buf, highlight_mode);
watch: tab + holizontal scroll