wezterm: tab activity indicator
This commit is contained in:
parent
ef6d5a5145
commit
abd1d0fdee
1 changed files with 17 additions and 5 deletions
|
@ -67,12 +67,21 @@
|
||||||
(where t (t:find "^%w+-dl%s")) {: title :icon " " :color "#22BC00"}
|
(where t (t:find "^%w+-dl%s")) {: title :icon " " :color "#22BC00"}
|
||||||
_ {: title :icon " " :color "#F8F8F2"}))
|
_ {: title :icon " " :color "#F8F8F2"}))
|
||||||
|
|
||||||
|
(fn show-tab-activity-indicator [panes]
|
||||||
|
(each [_ pane (ipairs panes)]
|
||||||
|
(when pane.has_unseen_output (lua "return true")))
|
||||||
|
false)
|
||||||
|
|
||||||
(wezterm.on :format-tab-title
|
(wezterm.on :format-tab-title
|
||||||
(fn [tab _tabs _panes _config _hover max-width]
|
(fn [tab _tabs _panes _config _hover max-width]
|
||||||
(let [raw-title (extract-tab-title tab)
|
(let [raw-title (extract-tab-title tab)
|
||||||
tab-info (extract-tab-info raw-title)
|
tab-info (extract-tab-info raw-title)
|
||||||
title (wezterm.truncate_right tab-info.title
|
title (wezterm.truncate_right tab-info.title
|
||||||
(- max-width 5))]
|
(- max-width 5))
|
||||||
|
(activity-indicator activity-color) (if (show-tab-activity-indicator tab.panes)
|
||||||
|
(values " "
|
||||||
|
"#FFB86C")
|
||||||
|
(values " " nil))]
|
||||||
(if tab.is_active
|
(if tab.is_active
|
||||||
[; Left
|
[; Left
|
||||||
{:Background {:Color colors.active-background}}
|
{:Background {:Color colors.active-background}}
|
||||||
|
@ -86,21 +95,24 @@
|
||||||
{:Attribute {:Italic true}}
|
{:Attribute {:Italic true}}
|
||||||
{:Text title}
|
{:Text title}
|
||||||
; Right
|
; Right
|
||||||
|
{:Foreground {:Color (or activity-color
|
||||||
|
colors.active-foreground)}}
|
||||||
{:Attribute {:Intensity :Normal}}
|
{:Attribute {:Intensity :Normal}}
|
||||||
{:Attribute {:Italic false}}
|
{:Attribute {:Italic false}}
|
||||||
{:Text " "}]
|
{:Text activity-indicator}]
|
||||||
[; Left
|
[; Left
|
||||||
{:Background {:Color colors.inactive-background}}
|
{:Background {:Color colors.inactive-background}}
|
||||||
{:Foreground {:Color colors.inactive-foreground}}
|
{:Foreground {:Color colors.inactive-foreground}}
|
||||||
{:Text " "}
|
{:Text " "}
|
||||||
; Center
|
; Center
|
||||||
{:Foreground {:Color tab-info.color}}
|
|
||||||
{:Text tab-info.icon}
|
|
||||||
{:Foreground {:Color colors.inactive-foreground}}
|
{:Foreground {:Color colors.inactive-foreground}}
|
||||||
|
{:Text tab-info.icon}
|
||||||
{:Attribute {:Italic false}}
|
{:Attribute {:Italic false}}
|
||||||
{:Text title}
|
{:Text title}
|
||||||
; Right
|
; Right
|
||||||
{:Text " "}]))))
|
{:Foreground {:Color (or activity-color
|
||||||
|
colors.inactive-foreground)}}
|
||||||
|
{:Text activity-indicator}]))))
|
||||||
;; Event: Ligatures
|
;; Event: Ligatures
|
||||||
(wezterm.on :update-status
|
(wezterm.on :update-status
|
||||||
(fn [window pane]
|
(fn [window pane]
|
||||||
|
|
Loading…
Reference in a new issue