fix: terminal title (#4352)

This commit is contained in:
Aram Drevekenin 2025-08-07 11:35:04 +02:00 committed by GitHub
parent 6848c8b136
commit 1b547b228a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -67,17 +67,17 @@ pub fn adjust_to_size(s: &str, rows: usize, columns: usize) -> String {
} }
pub fn make_terminal_title(pane_title: &str) -> String { pub fn make_terminal_title(pane_title: &str) -> String {
// if we receive a title, we display it, otherwise we display the session name format!(
if pane_title.is_empty() { "\u{1b}]0;{}{}\u{07}",
format!( get_session_name()
"\u{1b}]0;Zellij {}\u{07}", .map(|n| if pane_title.is_empty() {
get_session_name() format!("{}", n)
.map(|n| format!("({}) ", n)) } else {
.unwrap_or_default() format!("{} | ", n)
) })
} else { .unwrap_or_default(),
format!("\u{1b}]0;{}\u{07}", pane_title,) pane_title
} )
} }
// Colors // Colors