bat icon indicating copy to clipboard operation
bat copied to clipboard

Use `minus` as a paging library

Open AMythicDev opened this issue 3 years ago • 4 comments

I don't know what bat currently uses for paging (looks like less maybe) but it proposes two main problems. First is cross-compatiblity, bat cannot be packaged for Windows and requires less (which requires Mingw) to be installed. Second is less is binary and it's use as a library is not very perfect solution. These are the main problem minus solved. It's a pure rust library for paging output in a terminal. It provides great customisation of output which also being very compact

I wanted to know whether the bat team could implement this pager inside bat

Disclosure: I am the author of minus

AMythicDev avatar Feb 14 '21 14:02 AMythicDev

Thank you for posting here! I already had a closer look at minus before and I was already considering to use it as a solution to #1053. It looks great.

Maybe it would make sense to move the discussion to that ticket?

In particular, I would be interested if it could solve all/some of the listed bullet points.

You mentioned cross-compatibility. Does minus support non-ASCII terminals?

sharkdp avatar Feb 14 '21 17:02 sharkdp

I don't think minus implments much of the things in the checklist. In my opinion there are some things there that's not part of a usual pager. Anyway if you want you could always fork and do some edits or if you're fine with what's already there then it could be implemented

AMythicDev avatar Feb 15 '21 10:02 AMythicDev

I had gone through a very quick and dirty implementation of minus within bat and it works perfectly. Although if you want to get the features of that checklist I think you probably need to fork minus

AMythicDev avatar Feb 16 '21 12:02 AMythicDev

Hii @sharkdp! It has been a long time here. All this time, minus has grown a lot. It now has:-

  • Proper line wrapping
  • Native API for applications to define key/mouse actions
  • Better line numbering
  • Much improved search
  • Lots of optimization done when writing to the terminal

and much more...

Things like incremental searching and more are also on their way.

So I just wanted to ask whether can reconsider minus to be included inside bat.

AMythicDev avatar Oct 04 '23 11:10 AMythicDev