diff --git a/docs/changelog.md b/docs/changelog.md index 69063b77c..34ebc5ef6 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -37,6 +37,8 @@ As features stabilize some brief notes about them will accumulate here. window which contained the pane in which the variable was changed. #3524 * PNG images without an alpha channel could not be displayed by in the terminal. #3529. +* tab width calculation when returning a string with embedded escape + sequences from a `format-tab-title` event handler. #3481 ### 20230408-112425-69ae8472 diff --git a/wezterm-gui/src/tabbar.rs b/wezterm-gui/src/tabbar.rs index 1e6c0a208..06ac12c33 100644 --- a/wezterm-gui/src/tabbar.rs +++ b/wezterm-gui/src/tabbar.rs @@ -84,8 +84,9 @@ fn call_format_tab_title( } _ => { let s = String::from_lua(v, &*lua)?; + let line = parse_status_text(&s, CellAttributes::default()); Ok(Some(TitleText { - len: unicode_column_width(&s, None), + len: line.len(), items: vec![FormatItem::Text(s)], })) }