diff options
author | asami <asami@FreeBSD.org> | 1997-01-03 01:34:16 +0000 |
---|---|---|
committer | asami <asami@FreeBSD.org> | 1997-01-03 01:34:16 +0000 |
commit | 6959b461c155cfccefb2c9b1a1974496ff4cee34 (patch) | |
tree | 29825aeed8e850cd237bf14fa2ffa434565d0359 /misc/colorls | |
parent | eae1b941954a004d776211f28afddb6dbb44d53b (diff) | |
download | FreeBSD-ports-6959b461c155cfccefb2c9b1a1974496ff4cee34.zip FreeBSD-ports-6959b461c155cfccefb2c9b1a1974496ff4cee34.tar.gz |
Disable tabs in output when color is used. Now -G should work with
stty oxtabs (aka "-tabs") too.
Porblem reported by: jmz, among others
Diffstat (limited to 'misc/colorls')
-rw-r--r-- | misc/colorls/files/patch-aa | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/misc/colorls/files/patch-aa b/misc/colorls/files/patch-aa index bcbeb7a..f079ac2 100644 --- a/misc/colorls/files/patch-aa +++ b/misc/colorls/files/patch-aa @@ -109,6 +109,33 @@ printlink(p); (void)putchar('\n'); } +@@ -190,10 +214,22 @@ + dp->s_block); + if ((base += numrows) >= num) + break; +- while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) <= endcol){ +- (void)putchar('\t'); +- chcnt = cnt; +- } ++ ++ /* ++ * some terminals get confused if we mix tabs ++ * with color sequences ++ */ ++ if (f_color) ++ for (cnt = chcnt ; cnt <= endcol ; cnt++) { ++ (void)putchar(' '); ++ chcnt = cnt; ++ } ++ else ++ while ((cnt = ((chcnt + TAB) & ~(TAB - 1))) ++ <= endcol) { ++ (void)putchar('\t'); ++ chcnt = cnt; ++ } + endcol += colwidth; + } + (void)putchar('\n'); @@ -217,9 +241,13 @@ if (f_size) chcnt += printf("%*qd ", |