mirror of
https://github.com/sharkdp/bat
synced 2024-11-28 14:50:44 +00:00
fixed formatting of terminal title
This commit is contained in:
parent
b9b554248d
commit
069318b139
1 changed files with 5 additions and 2 deletions
|
@ -229,8 +229,11 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
|
||||||
|
|
||||||
fn set_terminal_title_to_inputs_names(inputs: &Vec<Input>) {
|
fn set_terminal_title_to_inputs_names(inputs: &Vec<Input>) {
|
||||||
let mut input_names = "bat: ".to_string();
|
let mut input_names = "bat: ".to_string();
|
||||||
for input in inputs.iter() {
|
for (index, input) in inputs.iter().enumerate() {
|
||||||
input_names = input_names + &input.description.name.to_string() + ", "
|
input_names += &input.description.name.to_string();
|
||||||
|
if index < inputs.len() - 1 {
|
||||||
|
input_names += ", ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print!("\x1b]2;{}\x07", input_names);
|
print!("\x1b]2;{}\x07", input_names);
|
||||||
io::stdout().flush().unwrap();
|
io::stdout().flush().unwrap();
|
||||||
|
|
Loading…
Reference in a new issue