diff --git a/src/bin/bat/app.rs b/src/bin/bat/app.rs index 09430623..ef22e93d 100644 --- a/src/bin/bat/app.rs +++ b/src/bin/bat/app.rs @@ -287,6 +287,7 @@ impl App { use_custom_assets: !self.matches.get_flag("no-custom-assets"), #[cfg(feature = "lessopen")] use_lessopen: self.matches.get_flag("lessopen"), + set_terminal_title: self.matches.get_flag("set_terminal_title"), }) } diff --git a/src/bin/bat/clap_app.rs b/src/bin/bat/clap_app.rs index e8222a1d..ba463996 100644 --- a/src/bin/bat/clap_app.rs +++ b/src/bin/bat/clap_app.rs @@ -168,6 +168,12 @@ pub fn build_app(interactive_output: bool) -> Command { "Include N lines of context around added/removed/modified lines when using '--diff'.", ), ) + .arg( + Arg::new("set_terminal_title") + .long("set_terminal_title") + .action(ArgAction::SetTrue) + .help("Sets terminal title when using a pager") + .long_help("Sets terminal title to filenames when using a pager."),) } app = app.arg( diff --git a/src/config.rs b/src/config.rs index 83acc7df..c5cc2abd 100644 --- a/src/config.rs +++ b/src/config.rs @@ -94,6 +94,9 @@ pub struct Config<'a> { // Whether or not to use $LESSOPEN if set #[cfg(feature = "lessopen")] pub use_lessopen: bool, + + // Weather or not to set terminal title when using a pager + pub set_terminal_title: bool, } #[cfg(all(feature = "minimal-application", feature = "paging"))]