diff --git a/guake/guake_app.py b/guake/guake_app.py index aa4d671be..b645dc545 100644 --- a/guake/guake_app.py +++ b/guake/guake_app.py @@ -1123,11 +1123,13 @@ def recompute_tabs_titles(self): if not use_vte_titles: return - # TODO NOTEBOOK this code only works if there is only one terminal in a - # page, this need to be rewritten - for terminal in self.get_notebook().iter_terminals(): - page_num = self.get_notebook().page_num(terminal.get_parent()) - self.get_notebook().rename_page(page_num, self.compute_tab_title(terminal), False) + notebook = self.get_notebook() + for page_num in range(notebook.get_n_pages()): + terminals = notebook.get_terminals_for_page(page_num) + if terminals: + main_terminal = terminals[0] + new_title = self.compute_tab_title(main_terminal) + notebook.rename_page(page_num, new_title, False) def load_cwd_guake_yaml(self, vte) -> dict: # Read the content of .guake.yml in cwd diff --git a/releasenotes/notes/bugfix-tab-names.yaml b/releasenotes/notes/bugfix-tab-names.yaml new file mode 100644 index 000000000..3054aa5ca --- /dev/null +++ b/releasenotes/notes/bugfix-tab-names.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix shortened path tab names layout issue (#2321). + Tabs now correctly update their shortened titles regardless of splits layout.