4 ms·
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 reasonabl
by CGamesPlay 6mo ago
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's some ideas there that could be leveraged.
- zeech 6mo agoI went looking for a 'new' pager a couple years back and settled on this [0]. I've since gone back to `less` since it got annoying jumping between systems and having different pagers, but when I used it it was quite nice. [0] https://github.com/walles/moor https://github.com/walles/moor
- anthk 6mo agoThat should be under a less(1) flag, but optional as it can mess piping.
- busfahrer 6mo agoI've noticed that subconsciously, I've started to use `bat` for interactive paging, even though that's not its main use case
- CGamesPlay 6mo agoBat just uses less internally. And it deliberately breaks less’ handling of ^C, annoyingly.
- indentit 6mo agoBat has an option to use a built-in pager, a Rust crate called minus
- CGamesPlay 6mo agoDidn't know that! I tried it and it doesn't work for me, sadly. Test case: `seq 1 100 | bat --pager=builtin` Result: immediate exit, no output printed at all. https://github.com/sharkdp/bat/issues/1053 https://github.com/sharkdp/bat/issues/1053
- drabbiticus 6mo ago> 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
- CGamesPlay 6mo agoRealistically, 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.
- codethief 6mo ago+1 I actually came here hoping that OP had built a better `less`. Along with refresh, I'd also love to see mouse compatibility (scrolling etc.) and better performance when reading huge files.
- ilyagr 6mo agohttps://github.com/noborus/ov https://github.com/noborus/ov is another pager, in addition to `moor` that somebody else shared.
- gnubison 6mo agoIf you want ‘git diff | pager’ to work like that, you’re out of luck. There is no way for the pager to communicate with git or the shell to rerun the command; the pager doesn’t even know what program is on the writing side of its stdin pipe. You would need something like ‘pager --command "git diff"’, where the pager invokes a command producing output. I do agree that it would be nice.