diff options
author | Oliver looney <oliverjlooney@gmail.com> | 2024-01-27 14:14:40 +0000 |
---|---|---|
committer | Oliver looney <oliverjlooney@gmail.com> | 2024-01-27 14:14:40 +0000 |
commit | 9239b125b148af1833d85be972fc27d14895e7a6 (patch) | |
tree | dad65a8e911a19d9e5a434e81bebc21244665a59 /src | |
parent | b4fdb5dc360e067b7adf599e6d7184eb0f49920c (diff) |
added a flag to config for setting terminal title
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/bat/app.rs | 1 | ||||
-rw-r--r-- | src/bin/bat/clap_app.rs | 6 | ||||
-rw-r--r-- | src/config.rs | 3 |
3 files changed, 10 insertions, 0 deletions
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"))] |