summaryrefslogtreecommitdiff
path: root/_usage_footer.lua
diff options
context:
space:
mode:
authort <t@tjp.lol>2026-12-01 11:01:22 -0700
committert <t@tjp.lol>2026-12-01 11:02:02 -0700
commitf7a1e30c1dfbe5fddcbfe38e89a0c5efef9fbeab (patch)
tree18654fd9d61105577f896243d3009f49b3bdb89e /_usage_footer.lua
parent47039f21a170e29875a2676f7a2eb5a779144b74 (diff)
Restrict the Antigravity usage footer to TUI sessions
Diffstat (limited to '_usage_footer.lua')
-rw-r--r--_usage_footer.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/_usage_footer.lua b/_usage_footer.lua
index 2c27e8b..421afd5 100644
--- a/_usage_footer.lua
+++ b/_usage_footer.lua
@@ -130,6 +130,7 @@ function M.install(ext)
state = { sections = {} }
package.loaded[slot] = state
ext.on("render_footer", function(event)
+ if event.has_tui == false then return end
local inner = event:get_component()
state.handle = event:set_component({
render = function(_, width)
@@ -147,6 +148,7 @@ function M.install(ext)
return lines
end,
})
+ if state.handle and next(state.sections) then start_clock(state) end
end)
ext.on("session_end", function()
state.closed = true
@@ -169,8 +171,10 @@ function M.publish(ext, key, section, windows, status, opts)
end
if type(section) ~= "function" and type(section) ~= "string" then return false end
state.sections[key] = section
- start_clock(state)
- if state.handle then state.handle:invalidate() end
+ if state.handle then
+ start_clock(state)
+ state.handle:invalidate()
+ end
return true
end