mirror of
https://github.com/sharkdp/bat.git
synced 2026-02-08 00:32:08 +00:00
Merge pull request #3527 from Anchal-T/master
Fix bat crash with BusyBox less on Windows
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
- Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)
|
- Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
- Fix crash with BusyBox `less` on Windows, see #3527 (@Anchal-T)
|
||||||
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
|
- `--help` now correctly honors `--pager=builtin`. See #3516 (@keith-hall)
|
||||||
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
|
- `--help` now correctly honors custom themes. See #3524 (@keith-hall)
|
||||||
- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
|
- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
|
||||||
|
|||||||
@@ -131,8 +131,13 @@ impl OutputType {
|
|||||||
p.arg("-S"); // Short version of --chop-long-lines for compatibility
|
p.arg("-S"); // Short version of --chop-long-lines for compatibility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let less_version = retrieve_less_version(&pager.bin);
|
||||||
|
|
||||||
// Ensures that 'less' quits together with 'bat'
|
// Ensures that 'less' quits together with 'bat'
|
||||||
p.arg("-K"); // Short version of '--quit-on-intr'
|
// The BusyBox version of less does not support -K
|
||||||
|
if less_version != Some(LessVersion::BusyBox) {
|
||||||
|
p.arg("-K"); // Short version of '--quit-on-intr'
|
||||||
|
}
|
||||||
|
|
||||||
// Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
|
// Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
|
||||||
// versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
|
// versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
|
||||||
@@ -142,7 +147,7 @@ impl OutputType {
|
|||||||
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
|
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
|
||||||
// is not needed anymore.
|
// is not needed anymore.
|
||||||
if single_screen_action == SingleScreenAction::Quit {
|
if single_screen_action == SingleScreenAction::Quit {
|
||||||
match retrieve_less_version(&pager.bin) {
|
match less_version {
|
||||||
None => {
|
None => {
|
||||||
p.arg("--no-init");
|
p.arg("--no-init");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user