I made a terminal pager
Posted by speckx 1 day ago
Comments
Comment by CGamesPlay 1 day ago
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.
Comment by zeech 1 day ago
Comment by busfahrer 1 day ago
Comment by CGamesPlay 1 day ago
Comment by indentit 20 hours ago
Comment by CGamesPlay 13 hours ago
Comment by gnubison 18 hours ago
Comment by codethief 1 day ago
Comment by ilyagr 21 hours ago
Comment by drabbiticus 1 day ago
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
Comment by CGamesPlay 1 day ago
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.
Comment by anthk 1 day ago
Comment by asibahi 1 day ago
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.
Comment by dyauspitr 1 day ago
Comment by pekim 1 day ago
Comment by asibahi 1 day ago
Comment by goodmythical 1 day ago
But it is indeed just the single character (U+FDFD)
Comment by da_rob 1 day ago
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
Comment by Cthulhu_ 1 day ago
Comment by xk3 19 hours ago
I rarely pipe to a pager because kitty/fish/tmux support OSC 133 pretty well and I can press one button to go up to the previous command prompt and another button to go back. I can press a few keys to search the scrollback. It all works seamlessly across SSH sessions too if you set it up right.
# tmux
bind-key -T copy-mode C-Home send -X history-top
bind-key -T copy-mode C-End send -X history-bottom
bind -T copy-mode C-Up send-keys -X previous-prompt
bind -T copy-mode C-Down send-keys -X next-prompt
# kitty
map ctrl+up scroll_to_prompt -1
map ctrl+down scroll_to_prompt 1
map shift+PAGE_UP scroll_page_up
map shift+PAGE_DOWN scroll_page_down
# fish shell config.fish
if test -z "$SSH_TTY"; and test -z "$TMUX"
bind pageup "kitty @ scroll-window 1p-"
bind pagedown "kitty @ scroll-window 1p"
endComment by ancientcatz 1 day ago
Comment by netghost 1 day ago
Comment by project2501a 1 day ago
Comment by vomayank 1 day ago
What was the main limitation in existing pagers like less that pushed you to build a new one?
Comment by lrobinovitch 1 day ago
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 configurable as I call out in the post. I took the functionality I needed, made it a reusable component for Go TUIs, then made a terminal pager in the form of a Go TUI with it.
Comment by vomayank 15 hours ago
Do you see this being used mainly as an embedded component inside Go TUIs, or as a standalone pager replacement in daily workflows?
Comment by ghthor 1 day ago
Comment by ErroneousBosh 1 day ago
Comment by efaref 1 day ago
I think it still needs some work for more general use which I unfortunately don't have time for at the moment.
Comment by thegdsks 1 day ago
Comment by pimlottc 1 day ago
> lore supports only a subset of what less does, but in a more intuitive and useful manner for my daily activity. I also find value in understanding it from the ground up, bytes to terminal views, and continuing to refine it as I learn more about what I actually want and need in a terminal pager.
Comment by gandreani 1 day ago
Comment by broken-kebab 1 day ago
Comment by ErroneousBosh 1 day ago
Comment by mnkyprskbd 1 day ago
Comment by asibahi 1 day ago
Comment by joombaga 1 day ago
Comment by teki_one 1 day ago
Comment by teo_zero 1 day ago
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!
Comment by technojamin 1 day ago
Comment by saghm 1 day ago
Comment by jzer0cool 1 day ago
Comment by dostick 1 day ago
Comment by nkoren 1 day ago
Comment by jauntywundrkind 1 day ago
Would love if anyone has thoughts or suggestions. It was quick and dirty, and works fine for my use, but I'm not sure where else I could take this, how else I might splice apart the problem, what else would suit it. https://tangled.org/jauntywk.bsky.social/picker-power
Comment by fragmede 1 day ago
(too bad Cisco bought them and made it too expensive).
Also, no "less does more than more and most does more than less" joke?
Comment by umutnaber 1 day ago
Comment by sourcegrift 1 day ago
Comment by cocodill 1 day ago