add cwd to TabBarData

this option add current working directory to the tab by using active windows child directory.
This commit is contained in:
noval
2022-07-26 09:33:55 +07:00
parent fe8892ec54
commit 237bfc9a6e
3 changed files with 17 additions and 8 deletions

View File

@@ -25,6 +25,7 @@ class TabBarData(NamedTuple):
title: str
is_active: bool
needs_attention: bool
cwd: str
num_windows: int
num_window_groups: int
layout_name: str
@@ -179,6 +180,7 @@ def draw_title(draw_data: DrawData, screen: Screen, tab: TabBarData, index: int)
'num_windows': tab.num_windows,
'num_window_groups': tab.num_window_groups,
'title': tab.title,
'cwd': tab.cwd,
}
ColorFormatter.draw_data = draw_data
ColorFormatter.tab_data = tab
@@ -188,6 +190,7 @@ def draw_title(draw_data: DrawData, screen: Screen, tab: TabBarData, index: int)
'num_windows': tab.num_windows,
'num_window_groups': tab.num_window_groups,
'title': tab.title,
'cwd': tab.cwd,
'fmt': Formatter,
'sup': SupSub(data),
'sub': SupSub(data, True),