Experimental pager: lsp
Dirk Gouders <[email protected]> Sat, 08 Nov 2025 23:41:20 +0100
| Newsgroups | org.kernel.vger.util-linux |
|---|---|
| Message-ID | <[email protected]> |
Hello, some time ago (in May), I talked to Karel and he told me it would be OK for him if I write in util-linux about a terminal pager I am working on. Hopefully some of the experts here will find it interesting enough and the time to play with it and give some feedback. The pager's name is lsp - list pages (or least significant pager). Perhaps somewhat unlucky, because of "Language Server Protocol", but when I started it and searched the web I didn't realize any name collisions. Anyway, you will certainly ask "Who needs just another pager?". I implemented some features I was always missing in other pagers: - On window resizes, reload manual pages to fit the new window size. - Manual pages refer to others: allow to navigate to them. (And offer such links only if those manual pages exist on the running system, i.e. validate those references.) - Allow to open other manual pages and to switch among all opened files. Besides these "musts", I implemented a 3-level TOC mode that allows for faster (or a different way of) navigation in large manual pages. Further, an apropos buffer can be created to have all manual pages available and be able to visit them. Another nuance is the positioning of search matches: when I walk through git logs, I often want to move commit-wise and ideally have the commits starting in the first line. In lsp I search for "^commit", press ^l twice and from then on 'n' navigates to the next commit, positioning it to the first line. A latest feature that I implemented is the possibility to restart the parent process (currently only git). I find this useful when I do `git diff` before adding changes and realize whitespace changes or other small nits. I then keep the diff-session, correct those nits in my editor and in the diff-session just press 'r' to see those changes. Finally, the negative part: lsp currently has no raw mode, i.e. it uses ncurses and does all interpretation of SGR and backspace sequences. Raw mode is the next thing I want to realize. In case you are interested, lsp can be found at: https://github.com/dgouders/lsp Please use the next branch that has some recent fixes. If you use Gentoo, lsp can be found in the GURU repo. But manual installation isn't that hard, because ncurses is lsp's single dependency, besides meson for installation. Thank you and pardon in case you feel disturbed by this, Dirk