From d6ddfa9d1893e7c9573de588b98eb7dad6d2a240 Mon Sep 17 00:00:00 2001 From: chriszarate Date: Tue, 12 May 2020 22:29:03 -0400 Subject: [PATCH] Use f-string instead of format for tab_title templates --- kitty/tab_bar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/tab_bar.py b/kitty/tab_bar.py index c1f5ef616..76429d22c 100644 --- a/kitty/tab_bar.py +++ b/kitty/tab_bar.py @@ -54,11 +54,14 @@ def draw_title(draw_data: DrawData, screen: Screen, tab: TabBarData, index: int) screen.cursor.fg = draw_data.bell_fg screen.draw('🔔 ') screen.cursor.fg = fg + layout_name = tab.layout_name + num_windows = tab.num_windows template = draw_data.title_template + title = tab.title if tab.is_active and draw_data.active_title_template is not None: template = draw_data.active_title_template try: - title = template.format(title=tab.title, index=index, layout_name=tab.layout_name, num_windows=tab.num_windows) + title = eval(f"f'{template}'") except Exception as e: if template not in template_failures: template_failures.add(template)