From 2a52acdef404216fc24339a57d5266adc42a689c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 2 May 2018 21:07:45 +0530 Subject: [PATCH] Fix tab title not changing to reflect the window title when switching between different windows in a tab --- CHANGELOG.rst | 2 ++ kitty/tabs.py | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index adda578a5..c6ff10a6c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -45,6 +45,8 @@ version 0.9.1 [future] - Fix window focus gained/lost events not being reported to child programs when switching windows/tabs using the various keyboard shortcuts. +- Fix tab title not changing to reflect the window title when switching between different windows in a tab + version 0.9.0 [2018-04-15] ------------------------------ diff --git a/kitty/tabs.py b/kitty/tabs.py index 1d18e7fc6..675da7f2c 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -86,6 +86,9 @@ class Tab: # {{{ old_active_window.focus_changed(False) if new_active_window is not None: new_active_window.focus_changed(True) + tm = self.tab_manager_ref() + if tm is not None: + tm.update_tab_bar() @property def active_window(self): @@ -99,13 +102,13 @@ class Tab: # {{{ self.name = title or '' tm = self.tab_manager_ref() if tm is not None: - tm.title_changed(self.name) + tm.update_tab_bar() def title_changed(self, window): if window is self.active_window: tm = self.tab_manager_ref() if tm is not None: - tm.title_changed(window.title) + tm.update_tab_bar() def visible_windows(self): for w in self.windows: @@ -514,9 +517,6 @@ class TabManager: # {{{ self._set_active_tab(nidx) self.update_tab_bar() - def title_changed(self, new_title): - self.update_tab_bar() - def new_tab(self, special_window=None, cwd_from=None): idx = len(self.tabs) self._add_tab(Tab(self, special_window=special_window, cwd_from=cwd_from))