on master help sign in
Pass --no-init on Windows if less version < 559
864656bsharkdp
src/output.rs+6−1
@@ -86,11 +86,16 @@ impl OutputType {
86 // versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
86 // versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
87 //
87 //
88 // See: http://www.greenwoodsoftware.com/less/news.530.html
88 // See: http://www.greenwoodsoftware.com/less/news.530.html
89+ //
90+ // For newer versions (530 or 558 on Windows), we omit '--no-init' as it
91+ // is not needed anymore.
89 match retrieve_less_version() {
92 match retrieve_less_version() {
90 None => {
93 None => {
91 p.arg("--no-init");
94 p.arg("--no-init");
92 }
95 }
93− Some(version) if version < 530 => {
96+ Some(version)
97+ if (version < 530 || (cfg!(windows) && version < 558)) =>
98+ {
94 p.arg("--no-init");
99 p.arg("--no-init");
95 }
100 }
96 _ => {}
101 _ => {}