Comments (6)
What do you expect the behavior to be in this instance?
from hexyl.
What do you expect the behavior to be in this instance?
Anything but empty output, which makes it impossible to tell if anything is happening at all.
- Spitting out a bunch of zeroes as xxd does. But I guess it goes against the design of
hexyl
. - The zeroes before the skipped part. Let me explain.
dd if=/dev/zero count=5000B | hexyl
outputs
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│* │ ┊ │ ┊ │
│00001380│ 00 00 00 00 00 00 00 00 ┊ │⋄⋄⋄⋄⋄⋄⋄⋄┊ │
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘
so it would be cool if
hexyl /dev/zero
printed
┌────────┬─────────────────────────┬─────────────────────────┬────────┬────────┐
│00000000│ 00 00 00 00 00 00 00 00 ┊ 00 00 00 00 00 00 00 00 │⋄⋄⋄⋄⋄⋄⋄⋄┊⋄⋄⋄⋄⋄⋄⋄⋄│
│* │ ┊ │ ┊ │
and then hanged. So yeah, basically just flushing the output after the *
row.
from hexyl.
So yeah, basically just flushing the output after the
*
row.
Agreed. This is also what hexdump -C
and xxd -a
(-a = autoskip = squeezing) do.
Thank you for reporting this.
from hexyl.
Great, I'll look into fixing this today.
from hexyl.
It looks like the issue is a simple one-liner: the write buffer isn't flushed until the very end of output. I wrote it this way initially to mitigate performance issues from flushing the buffer, but benchmarks show that the effect is negligible. I've added a line that will flush after every line.
from hexyl.
It looks like the issue is a simple one-liner: the write buffer isn't flushed until the very end of output. I wrote it this way initially to mitigate performance issues from flushing the buffer, but benchmarks show that the effect is negligible. I've added a line that will flush after every line.
Thank you very much for looking into this! Any chance you could share those benchmark results? I also would have expected repeated flush calls for every line to be performance-relevant.
from hexyl.
Related Issues (20)
- Hexyl show garbage on LXTerminal HOT 2
- Add option to disable printing 0 bytes as ascii 0. HOT 1
- `--no-characters` causes output artifacts when squeezing lines HOT 5
- Is there a cheat sheet anywhere telling what color correlates to category of byte? HOT 3
- Add support for the NO_COLOR environment variable HOT 4
- Regression: broken pipe error
- Make --panels=auto the new default? HOT 3
- hexyl should not fail if `--panels=auto` is used and output is not a TTY
- Identical lines not squeezed HOT 3
- hexyl -C does the inverse of hexdump -C HOT 1
- Request: publish source tar with generated manpage HOT 3
- Support for different code pages / character tables
- Incorrect output when reading from terminal HOT 2
- Feature request: Ship as a crate HOT 3
- Display some non-printable characters like `bat --show-all` HOT 5
- Feature request: Comodore prg mode HOT 1
- CI artifact names conflict HOT 2
- Provide Statically Compiled Binaries for (aarch64|arm64) Linux
- Support raw output HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hexyl.