sharkdp / hexyl

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

Additional space on last line #69

Closed rfuest closed 4 years ago

rfuest commented 5 years ago

If the last line of data contains less than 8 bytes, an additional space is written after the outer_sep: https://github.com/sharkdp/hexyl/blob/175847787dd44cfa9536cb1a0980e81b450a587e/src/lib.rs#L340-L349

$ echo -n "12345678" | hexyl --color never --border ascii | wc -L
80

$ echo -n "1234567" | hexyl --color never --border ascii | wc -L
81

This causes an empty line before the footer if the the terminal is exactly 80 characters wide. Is this behavior intended or a bug, because the short_input_passes test also contains the tailing space?

sharkdp commented 5 years ago

That looks like a bug to me and should be fixed.

Thank you for reporting this!