mirror of
https://github.com/sharkdp/bat
synced 2026-08-04 19:01:44 +00:00
Merge branch 'master' into list-themes-term-probe-fix
This commit is contained in:
+3
-1
@@ -258,7 +258,9 @@ pub fn list_themes(
|
||||
fn set_terminal_title_to(new_terminal_title: String) {
|
||||
let osc_command_for_setting_terminal_title = "\x1b]0;";
|
||||
let osc_end_command = "\x07";
|
||||
print!("{osc_command_for_setting_terminal_title}{new_terminal_title}{osc_end_command}");
|
||||
// Prevent BEL/ESC/C1 bytes in the title from terminating or nesting the OSC.
|
||||
let safe_title = bat::sanitize_for_terminal(&new_terminal_title);
|
||||
print!("{osc_command_for_setting_terminal_title}{safe_title}{osc_end_command}");
|
||||
io::stdout().flush().unwrap();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user