sharkdp / hexyl

A command-line hex viewer
Apache License 2.0
8.92k stars 227 forks source link

Identical lines not squeezed #186

Open TheLocehiliosan opened 1 year ago

TheLocehiliosan commented 1 year ago

The help indicates:

--no-squeezing Displays all input data. Otherwise any number of groups of output lines which would be identical to the preceding group of lines, are replaced with a line comprised of a single asterisk.

It seems that lines are squeezed when they all are filled with the same single byte (for example, all 0x00 or all 0xFF). However, lines which are not filled with a single repeated byte can still be identical to previous lines. In these cases they do not appear to be squeezed.

I'll attach an example file, which contains rows filled with the two-byte word 0x1400 starting at position 00000020. If the standard two panels are displayed, I would expect this file to have data squeezed until position 00000fa0.

example.tar.gz

sharkdp commented 1 year ago

Thank you for reporting this. The documentation is just wrong. I don't think the squeezing feature was ever planned to work that way. But I now realize that hexdumps squeezing feature might actually do just that?

FYI: @awidegreen @sharifhsn

TheLocehiliosan commented 1 year ago

But I now realize that hexdumps squeezing feature might actually do just that?

Yes, hexdump does work that way.

sharifhsn commented 1 year ago

If hexdump will squeeze on identical lines always, then the squeezing feature should be changed to match hexdump. It's not difficult to make this change, I'll look at this sometime soon.