mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
add cwd to TabBarData
this option add current working directory to the tab by using active windows child directory.
This commit is contained in:
@@ -230,6 +230,11 @@ class Tab: # {{{
|
||||
ans += 1
|
||||
return ans
|
||||
|
||||
@property
|
||||
def get_cwd(self) -> str:
|
||||
w = self.active_window
|
||||
return w.cwd_of_child if w and w.cwd_of_child else self.cwd
|
||||
|
||||
def set_title(self, title: str) -> None:
|
||||
self.name = title or ''
|
||||
self.mark_tab_bar_dirty()
|
||||
@@ -1078,13 +1083,14 @@ class TabManager: # {{{
|
||||
title = (t.name or t.title or appname).strip()
|
||||
needs_attention = False
|
||||
has_activity_since_last_focus = False
|
||||
cwd = os.path.abspath(t.get_cwd)
|
||||
for w in t:
|
||||
if w.needs_attention:
|
||||
needs_attention = True
|
||||
if w.has_activity_since_last_focus:
|
||||
has_activity_since_last_focus = True
|
||||
ans.append(TabBarData(
|
||||
title, t is at, needs_attention,
|
||||
title, t is at, needs_attention, cwd,
|
||||
len(t), t.num_window_groups, t.current_layout.name or '',
|
||||
has_activity_since_last_focus, t.active_fg, t.active_bg,
|
||||
t.inactive_fg, t.inactive_bg
|
||||
|
||||
Reference in New Issue
Block a user