diff --git a/src/bin/bat/main.rs b/src/bin/bat/main.rs index d489992c..a94b6d23 100644 --- a/src/bin/bat/main.rs +++ b/src/bin/bat/main.rs @@ -205,6 +205,7 @@ pub fn list_themes( style.insert(StyleComponent::Plain); config.language = Some("Rust"); config.style_components = StyleComponents(style); + config.paging_mode = PagingMode::Always; let mut output_type = OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?; diff --git a/src/output.rs b/src/output.rs index aea37333..0926f2bf 100644 --- a/src/output.rs +++ b/src/output.rs @@ -141,16 +141,18 @@ impl OutputType { // // For newer versions (530 or 558 on Windows), we omit '--no-init' as it // is not needed anymore. - match retrieve_less_version(&pager.bin) { - None => { - p.arg("--no-init"); + if single_screen_action == SingleScreenAction::Quit { + match retrieve_less_version(&pager.bin) { + None => { + p.arg("--no-init"); + } + Some(LessVersion::Less(version)) + if (version < 530 || (cfg!(windows) && version < 558)) => + { + p.arg("--no-init"); + } + _ => {} } - Some(LessVersion::Less(version)) - if (version < 530 || (cfg!(windows) && version < 558)) => - { - p.arg("--no-init"); - } - _ => {} } } else { p.args(args);