--tab-title=current should respect any override title set on the tab
This commit is contained in:
parent
5d76cfb578
commit
afebea8635
@ -353,7 +353,7 @@ def launch(
|
|||||||
opts.window_title = active.title if active else None
|
opts.window_title = active.title if active else None
|
||||||
if opts.tab_title == 'current':
|
if opts.tab_title == 'current':
|
||||||
atab = boss.active_tab
|
atab = boss.active_tab
|
||||||
opts.tab_title = atab.title if atab else None
|
opts.tab_title = atab.effective_title if atab else None
|
||||||
if opts.os_window_title == 'current':
|
if opts.os_window_title == 'current':
|
||||||
tm = boss.active_tab_manager
|
tm = boss.active_tab_manager
|
||||||
opts.os_window_title = get_os_window_title(tm.os_window_id) if tm else None
|
opts.os_window_title = get_os_window_title(tm.os_window_id) if tm else None
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from operator import attrgetter
|
|||||||
from time import monotonic
|
from time import monotonic
|
||||||
from typing import (
|
from typing import (
|
||||||
Any, Deque, Dict, Generator, Iterable, Iterator, List, NamedTuple,
|
Any, Deque, Dict, Generator, Iterable, Iterator, List, NamedTuple,
|
||||||
Optional, Pattern, Sequence, Set, Tuple, Union, cast
|
Optional, Pattern, Sequence, Set, Tuple, Union
|
||||||
)
|
)
|
||||||
|
|
||||||
from .borders import Border, Borders
|
from .borders import Border, Borders
|
||||||
@ -210,7 +210,12 @@ class Tab: # {{{
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def title(self) -> str:
|
def title(self) -> str:
|
||||||
return cast(str, getattr(self.active_window, 'title', appname))
|
w = self.active_window
|
||||||
|
return w.title if w else appname
|
||||||
|
|
||||||
|
@property
|
||||||
|
def effective_title(self) -> str:
|
||||||
|
return self.name or self.title
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number_of_windows_with_running_programs(self) -> int:
|
def number_of_windows_with_running_programs(self) -> int:
|
||||||
@ -686,7 +691,7 @@ class Tab: # {{{
|
|||||||
if field == 'id':
|
if field == 'id':
|
||||||
return bool(pat.pattern == str(self.id))
|
return bool(pat.pattern == str(self.id))
|
||||||
if field == 'title':
|
if field == 'title':
|
||||||
return pat.search(self.name or self.title) is not None
|
return pat.search(self.effective_title) is not None
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def __iter__(self) -> Iterator[Window]:
|
def __iter__(self) -> Iterator[Window]:
|
||||||
@ -709,7 +714,7 @@ class Tab: # {{{
|
|||||||
self.windows = WindowList(self)
|
self.windows = WindowList(self)
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return f'Tab(title={self.name or self.title}, id={hex(id(self))})'
|
return f'Tab(title={self.effective_title}, id={hex(id(self))})'
|
||||||
|
|
||||||
def make_active(self) -> None:
|
def make_active(self) -> None:
|
||||||
tm = self.tab_manager_ref()
|
tm = self.tab_manager_ref()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user