Live data from Hacker News

I made a terminal pager

theleo.zone

31–40 of 51 posts

Re: I made a terminal pager

#31
post #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…

To be pedantic, you mean a standard like IEEE 1003 aka POSIX? (https://pubs.opengroup.org/onlinepubs/9799919799/utilities/m...)

Re: I made a terminal pager

#32
I wrote streampager a few years ago to scratch a similar itch. It works well enough for my own uses (and is/was used in library form as the built-in pager for sapling and jj).

I think it still needs some work for more general use which I unfortunately don't have time for at the moment.

Re: I made a terminal pager

#33

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'…

I've noticed that subconsciously, I've started to use `bat` for interactive paging, even though that's not its main use case

Re: I made a terminal pager

#34

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'…

I've noticed that subconsciously, I've started to use `bat` for interactive paging, even though that's not its main use case

Bat just uses less internally. And it deliberately breaks less’ handling of ^C, annoyingly.

Re: I made a terminal pager

#36
post #5

[flagged]

Author here! If I were to give this post a longer title, it would be "I made a terminal pager because I needed a really good viewport component for my Go TUIs, then realized that a TUI viewport is just a mini terminal pager and I want the same text navigation and manipulation experience everywhere that I encounter long text blocks in my terminal". I take no issue at all with `less`, it's super powerful and configurab…

"Because I felt like it" is also a perfectly acceptable answer ;-)

Re: I made a terminal pager

#37
Slightly related: I am an Arab who speaks Arabic and reads Arabic and the only place I ever see the unicode character ﷽ is by programmers giving an example of "unicode is too hard".

Perhaps as a graphical element at the beginning of books, too.

It is a part of the Arabic Presentation Forms block which explicitly is for supporting legacy encodings and should not be used.

Re: I made a terminal pager

#38
post #37

Slightly related: I am an Arab who speaks Arabic and reads Arabic and the only place I ever see the unicode character ﷽ is by programmers giving an example of "unicode is too hard". Perhaps as a graphical element at the beginning of books, too. It is a part of the Arabic Presentation Forms block which explicitly is for supporting legacy encodings and should not be used.

The whole phrase is one character?

Re: I made a terminal pager

#39

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'…

> holds my place

can you give an example of what you mean and how you might expect it to be achieved with a reloaded diff? otherwise `while true; git diff --color=always |less -r; done` gets you most of the way to what you are asking for

Re: I made a terminal pager

#40

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'…

> holds my place can you give an example of what you mean and how you might expect it to be achieved with a reloaded diff? otherwise `while true; git diff --color=always |less -r; done` gets you most of the way to what you are asking for

Realistically, I will be reviewing a diff, see a hunk I don’t like, change it, and want to see the change back in less. So saving my scroll offset would accomplish my goal. I guess I should add that I want to be able to quit as well?

Like I said, fzf does this. Bind a key to an action that effectively changes the file from stdin to a different command that it runs, while preserving view state.

Post reply on HN