Coder Social home page Coder Social logo

Automatic paging? about hexyl HOT 13 CLOSED

sharkdp avatar sharkdp commented on May 18, 2024 2
Automatic paging?

from hexyl.

Comments (13)

sharkdp avatar sharkdp commented on May 18, 2024 7

You can pipe to less, if you use the -R/--RAW-CONTROL-CHARS option (or export LESS="-R"):

export LESS="-R" # I suggest adding this to your shells RC file
hexyl … | less

from hexyl.

jamadagni avatar jamadagni commented on May 18, 2024 5

Hello. It would be useful if hexyl piped to less automatically rather than requiring user to manually pipe.

from hexyl.

sharkdp avatar sharkdp commented on May 18, 2024 2

Re-opening this to see what others think.

from hexyl.

 avatar commented on May 18, 2024 2

This sounds like an appealing feature, but I'm not aware of what the drawbacks might be, and piping through less is pretty straightforward. What pain did this cause with bat?

I would also say the default behavior of --color should probably be auto, not always, but maybe that's a discussion for another thread.

from hexyl.

zeenix avatar zeenix commented on May 18, 2024 1

I'd rather not implement paging by default, see #30 (comment)

I'd urge you to reconsider. Not sure what kind of pain it caused in bat but most modern (after git) CLI do this and it's very surprising when you try a very modern tool like hexyl and it doesn't do paging by default. I added colors and paging by default to gst-inspect command 2 years ago and except for a few people, everyone was super thankful.

As long as there is an easy option to disable paging and colors, even the folks who don't want it will be fine. Your decision of course!

from hexyl.

sharkdp avatar sharkdp commented on May 18, 2024 1

Not sure what kind of pain it caused in bat

What pain did this cause with bat?

If you want a taste of it, you can take a look at sharkdp/bat#1053 😄. See the list of bug tickets in the first bullet point.

I would also say the default behavior of --color should probably be auto, not always, but maybe that's a discussion for another thread.

All my other applications use "auto" by default. We decided to use "always" for hexyl, because (1) the defining feature of hexyl is the colored output and (2) because it makes it much easier for users to pipe to less.

If we decide to add automatic paging, we could certainly switch to "auto".

from hexyl.

ZimbiX avatar ZimbiX commented on May 18, 2024 1

@siedentop I don't think a lack of paging is related to your issue. Unix piping runs all processes at once, streaming the stdout between them - rather than waiting for the preceding one to finish, which could get blocked by a bad paging implementation, if that's what you were thinking. You haven't provided detail of what you're searching for (which may not work given the line wrapping of the output). But it could be the ANSI colour characters causing your trouble, as Hexyl does not automatically disable colour when piping - try --color=never. If that's not it, you should open your own issue.

from hexyl.

siedentop avatar siedentop commented on May 18, 2024 1

Thanks, @ZimbiX. If I use hexyl --color=never <file> | rg foo it works. If I use --color=auto it also works. So, maybe --color should default to auto? (But that's been addressed by David above.)

from hexyl.

sharkdp avatar sharkdp commented on May 18, 2024

I'd rather not implement paging by default, see #30 (comment)

from hexyl.

zeenix avatar zeenix commented on May 18, 2024

Not sure what kind of pain it caused in bat

What pain did this cause with bat?

If you want a taste of it, you can take a look at sharkdp/bat#1053 smile. See the list of bug tickets in the first bullet point.

I might be wrong but seems the majority of those issues are Windows-specific. IMHO it's a lot more important to provide a good user experience than portability across all OSes.

If we decide to add automatic paging, we could certainly switch to "auto".

👍

from hexyl.

sharkdp avatar sharkdp commented on May 18, 2024

IMHO it's a lot more important to provide a good user experience than portability across all OSes.

as long as you are using one of the supported OSes? 😄

from hexyl.

siedentop avatar siedentop commented on May 18, 2024

Hi David,

I found this ticket by searching for 'pipe' in the list of issues.

I don't know how paging exactly relates to this but anyway: My use case is that I wanted to use hexyl <file> | rg foo. This didn't work and instead I used xxd <file> | rg foo.

If paging support would help my use case, then I would very much appreciate paging support.

from hexyl.

sharkdp avatar sharkdp commented on May 18, 2024

I'm closing this due to inactivity. Please feel free to comment in case it should be re-opened.

from hexyl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.