mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-22 13:12:23 +00:00
Allow showing the currently active session name in the tab bar
This commit is contained in:
parent
4c0752fd07
commit
41488fe8ba
4 changed files with 19 additions and 0 deletions
|
|
@ -60,6 +60,21 @@ In this manner you can define as many projects/sessions as you like and easily
|
|||
switch between them with a keypress.
|
||||
|
||||
|
||||
Displaying the currently active session name
|
||||
----------------------------------------------
|
||||
|
||||
You can display the name of the currently active session file in the kitty tab
|
||||
bar using :opt:`tab_title_template`. For example, using the value::
|
||||
|
||||
{session_name} {title}
|
||||
|
||||
will show you the name of the session file the current tab was loaded from, as
|
||||
well as the normal tab title. Or alternatively, you can set the tab title
|
||||
directly to a project name in the session file itself when creating the tab,
|
||||
like this::
|
||||
|
||||
new_tab My Project Name
|
||||
|
||||
.. _complex_sessions:
|
||||
|
||||
More complex sessions
|
||||
|
|
|
|||
|
|
@ -1471,6 +1471,8 @@ use :code:`{sup.index}`. All data available is:
|
|||
The tab index usable with :ac:`goto_tab N <goto_tab>` shortcuts.
|
||||
:code:`layout_name`
|
||||
The current layout name.
|
||||
:code:`session_name`
|
||||
The name of the kitty session file from which this tab was created, if any.
|
||||
:code:`num_windows`
|
||||
The number of windows in the tab.
|
||||
:code:`num_window_groups`
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ class TabBarData(NamedTuple):
|
|||
num_of_windows_with_progress: int
|
||||
total_progress: int
|
||||
last_focused_window_with_progress_id: int
|
||||
session_name: str
|
||||
|
||||
|
||||
class DrawData(NamedTuple):
|
||||
|
|
|
|||
|
|
@ -1374,6 +1374,7 @@ class TabManager: # {{{
|
|||
has_activity_since_last_focus, t.active_fg, t.active_bg,
|
||||
t.inactive_fg, t.inactive_bg, t.num_of_windows_with_progress,
|
||||
t.total_progress, t.last_focused_window_with_progress_id,
|
||||
t.created_in_session_name,
|
||||
))
|
||||
return ans
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue