Commit Graph

12 Commits

Author SHA1 Message Date
John Higgins 7b2e0ece55
Prevent fork nightmare with PAGER=batcat (#2235)
* Added rsamuelklatchko's changes

* Added some comments and deleted redundant code

* Ran cargo fmt

* Update src/pager.rs

Co-authored-by: Martin Nordholts <enselic@gmail.com>

* Added bugfix to changelog

* src/pager.rs nitpick: arg0 -> s

I forgot to comment on this name so I figured I'd just push a commit to
take care of it.

Co-authored-by: Martin Nordholts <enselic@gmail.com>
2022-08-12 14:27:47 +02:00
Mohamed Abdelnour aa74d19940 Refactor "Use `matches` macro" 2021-05-27 12:05:07 +02:00
Mohamed Abdelnour 23fd11e806 Use `matches` macro 2021-05-27 12:05:07 +02:00
Martin Nordholts dc1620d1f0 get_pager(): Simplify use_less_instead expression 2021-01-11 21:56:10 +01:00
Martin Nordholts dd0d44bbb3 Fix #1413 Can't use `bat` at all! (Error: Use of bat as a pager is disallowed...)
Fixed by implementing the proposal by sharkdp:

* Allow PAGER=bat, but ignore the setting in bat and simply default to
  less. Unless of course, BAT_PAGER or --pager is used to overwrite the
  value of PAGER.

* Disallow the usage of bat within BAT_PAGER and --pager.
2021-01-11 21:56:10 +01:00
Martin Nordholts 7809008016 PagerKind::from(): Simplify 2021-01-10 13:40:07 +01:00
Martin Nordholts dd6f57e107 pager.rs: Some comment fixups 2021-01-10 13:25:18 +01:00
Martin Nordholts dfe7a60140 PagerSource: [Bat]PagerEnvVar -> EnvVar[Bat]Pager 2021-01-10 13:16:09 +01:00
Martin Nordholts fc30277cfa pager.rs: Limit visibilities to pub(crate) 2021-01-10 13:07:37 +01:00
Martin Nordholts bfa5342331 Also replace 'more' from PAGER with 'less'
But first do some quite significant refactorings to keep the code clean
and easy to understand.
2020-12-30 17:59:30 +01:00
Martin Nordholts dcfe883f4b Simplify and polish pager.rs and related code 2020-12-28 22:39:34 +01:00
Martin Nordholts f4202361b4 Add Pager helper with info about where the value comes from
In preparation of fixing issue #1063.
This is a pure refactoring with no intended functional side effects.
2020-11-27 06:42:58 +01:00