Live data from Hacker News

I made a terminal pager

theleo.zone

21–30 of 51 posts

Re: I made a terminal pager

#21
How does this compare to less with syntax highlighting? I've been using bat as a pager (bat --paging=always) and it covers most of what I need. Curious what the advantage is for larger files.

Re: I made a terminal pager

#24

If I remember correctly, `gum` also provides a pager feature: https://github.com/charmbracelet/gum

TIL about `gum`. I love this and endeavor to integrate it into something sometime. Thank you for mentioning it!

Oh, you will love all of charmbracelet

https://github.com/charmbracelet

Re: I made a terminal pager

#25

bat is the king of pagers. https://github.com/sharkdp/bat

bat does not look like a pager: https://github.com/sharkdp/bat?tab=readme-ov-file#automatic-...

In fact it's not. The name itself mimicks cat, not less. It's a filter that adds annotations to its input, such as syntax highlighting, git diffs and special-char coloring.

Personally I can't find any use for bat: I'm a devote user of vim for editing, and it already does all of this, so why not using it to view files as well? It's satisfying to have the same interface, colors and shortcuts whether you're editing or viewing!

Re: I made a terminal pager

#27

I am definitely waiting for a "modern less replacement" in the same vein as fd, sd, fzf, and the rest of the under-20yo cli crew. I get that "less" is reasonably maintained still. I think the killer feature for me would be refresh. I get that this can't work for piped input, but I want `git diff` to show in a pager with a refresh button that holds my place. fzf supports both refresh and piped input, so perhaps there'…

That should be under a less(1) flag, but optional as it can mess piping.

Re: I made a terminal pager

#28
Well-written article!

I wish there was some kind of standard to tell CLI apps what features to expect from the system pager, so they can act accordingly …

Right now, apps can talk to the terminal to check for feature support, but all of that falls apart when the output is piped to a pager. (Do we support inline links? ANSI colors? Sixel support??)

Shameless plug, specifically regarding Sixel support: I needed a pager with better image support than just less -r and made https://github.com/roblillack/lessi

Re: I made a terminal pager

#30

How does this compare to less with syntax highlighting? I've been using bat as a pager (bat --paging=always) and it covers most of what I need. Curious what the advantage is for larger files.

[deleted]
Post reply on HN