mirror of
https://github.com/sharkdp/bat
synced 2026-08-07 19:31:42 +00:00
successfully setting the terminal title to bat's input's names
This commit is contained in:
+1
-8
@@ -1,6 +1,5 @@
|
||||
use shell_words::ParseError;
|
||||
use std::{env, io};
|
||||
use std::io::Write;
|
||||
use std::{env};
|
||||
|
||||
/// If we use a pager, this enum tells us from where we were told to use it.
|
||||
#[derive(Debug, PartialEq)]
|
||||
@@ -37,11 +36,6 @@ pub(crate) enum PagerKind {
|
||||
Unknown,
|
||||
}
|
||||
|
||||
fn set_terminal_title(title: &str) {
|
||||
print!("\x1b]2;{}\x07", title);
|
||||
io::stdout().flush().unwrap();
|
||||
}
|
||||
|
||||
impl PagerKind {
|
||||
fn from_bin(bin: &str) -> PagerKind {
|
||||
use std::path::Path;
|
||||
@@ -108,7 +102,6 @@ pub(crate) fn get_pager(config_pager: Option<&str>) -> Result<Option<Pager>, Par
|
||||
};
|
||||
|
||||
let parts = shell_words::split(cmd)?;
|
||||
set_terminal_title("test");
|
||||
match parts.split_first() {
|
||||
Some((bin, args)) => {
|
||||
let kind = PagerKind::from_bin(bin);
|
||||
|
||||
Reference in New Issue
Block a user