On Fri, 15 Apr 2022 at 05:49, Kang-Che Sung <explore...@gmail.com> wrote: > What's the difference between the NORMAL escape and the UNHIGHLIGHT escape? > Is there a test case to demonstrate th>
The UNHIGHLIGHT escape flips only the HIGHLIGHT (invert, actually) bit back to off. The normal escape flips ALL special display bits back to off, including color. We don't want that in case there is a highlighted term (e.g. another control sequence) in between a colored line. test case: printf '\033[33mhello\033\007\013hi\033[m' > ./tmp Compare how busybox less without this 2nd patch vs. greenwood less (and bbless with this patch) shows the output. In the former, the colored line is just cut short because of the highlighted control chars. In the latter, the entire line is colored, with small highlighted (colored) sections in between. One thing this cannot deal with is a highlight escape in the input itself, which would be cut short by any less-emmitted highlight sequence. Avoiding that would probably require looking at the escapes and keeping state. _______________________________________________ busybox mailing list busybox@busybox.net http://lists.busybox.net/mailman/listinfo/busybox