Fixed terminal title
This commit is contained in:
+1
-3
@@ -30,19 +30,17 @@ fn main() {
|
|||||||
.creation_flags(CREATE_NO_WINDOW)
|
.creation_flags(CREATE_NO_WINDOW)
|
||||||
.spawn();
|
.spawn();
|
||||||
} else {
|
} else {
|
||||||
// Extract just the script name
|
|
||||||
let script_name = Path::new(&args[0])
|
let script_name = Path::new(&args[0])
|
||||||
.file_name()
|
.file_name()
|
||||||
.map(|s| s.to_string_lossy().into_owned())
|
.map(|s| s.to_string_lossy().into_owned())
|
||||||
.unwrap_or_else(|| String::from("Script"));
|
.unwrap_or_else(|| String::from("Script"));
|
||||||
|
|
||||||
// Format the exact title you want
|
|
||||||
let tab_title = format!("Python > {}", script_name);
|
let tab_title = format!("Python > {}", script_name);
|
||||||
|
|
||||||
let mut cmd_args = vec![
|
let mut cmd_args = vec![
|
||||||
String::from("/k"),
|
String::from("/k"),
|
||||||
String::from("TITLE"),
|
String::from("TITLE"),
|
||||||
tab_title, // Apply your custom title here
|
tab_title,
|
||||||
String::from("&"),
|
String::from("&"),
|
||||||
String::from("python"),
|
String::from("python"),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user