File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 99- Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk )
1010
1111## Bugfixes
12+ - Fix crash with BusyBox ` less ` on Windows, see #3527 (@Anchal-T )
1213- ` --help ` now correctly honors ` --pager=builtin ` . See #3516 (@keith-hall )
1314- ` --help ` now correctly honors custom themes. See #3524 (@keith-hall )
1415- Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl )
Original file line number Diff line number Diff line change @@ -131,8 +131,13 @@ impl OutputType {
131131 p. arg ( "-S" ) ; // Short version of --chop-long-lines for compatibility
132132 }
133133
134+ let less_version = retrieve_less_version ( & pager. bin ) ;
135+
134136 // Ensures that 'less' quits together with 'bat'
135- p. arg ( "-K" ) ; // Short version of '--quit-on-intr'
137+ // The BusyBox version of less does not support -K
138+ if less_version != Some ( LessVersion :: BusyBox ) {
139+ p. arg ( "-K" ) ; // Short version of '--quit-on-intr'
140+ }
136141
137142 // Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
138143 // versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
@@ -142,7 +147,7 @@ impl OutputType {
142147 // For newer versions (530 or 558 on Windows), we omit '--no-init' as it
143148 // is not needed anymore.
144149 if single_screen_action == SingleScreenAction :: Quit {
145- match retrieve_less_version ( & pager . bin ) {
150+ match less_version {
146151 None => {
147152 p. arg ( "--no-init" ) ;
148153 }
You can’t perform that action at this time.
0 commit comments