tern-sidebar: one dot per agent tab

An open-source plugin for the Tern terminal. Each side tab shows one dot that says whether its coding agent is working, waiting for me, failed or done since I last looked.

45 of CSS and 46 of Luau
91 lines
published 1 December 2026, in daily use
v1.0.0
What
Plugin for the Tern terminal: 45 lines of CSS and 46 of Luau, open source under MIT
When
First version 6 November 2026 for my own setup, published as v1.0.0 on 1 December 2026, in daily use
Stack
CSS and Luau on Tern's plugin API
Needs
Tern 0.9.40 or newer with side tabs
Tested
macOS, with omp agents and plain shells

I run my coding agents in the side tabs of Tern, one tab per task. On 1 December 2026 the window had 31 tabs in 9 sessions, and 31 of their 32 panes ran an agent. Tern 0.9.40 shows an agent's state as a small badge on the corner of the tab's program icon. In a list that long I could not read the badges at a glance, and a turn that finished while I was in another tab left no mark on its row.

tern-sidebar removes the icon and puts one dot in its place. I had the same dots in cmux-sidebar. Tern already has the tab list, so here the plugin changes only the mark on each row.

A test session with six fake agents, each a shell script that reports its state to Tern the way a real agent does. Opening the docs tab clears its green dot.

What the dots mean

  • Blue: the agent is in the middle of a turn, or a shell command is running.
  • Amber: it needs me. The agent asked a question or wants a permission, or the program rang the bell.
  • Red: a turn or a command failed, or the program exited with an error.
  • Green: the work finished while I was somewhere else. It clears when I open the tab, so green always means a result I have not read.
  • No dot: idle.

How it works

The CSS half hides the icon and turns its slot into a 6 px circle. Tern writes the pane's state into that slot as a data-st attribute, so blue, amber and red are one selector each.

Green needs code. Tern keeps an unseen alert on a pane until I look at it, and its plugin API exposes that as a boolean. A Luau handler runs on focus changes and on agent and command events, reads the panes, and writes one CSS rule for every pane whose alert is still set. The plugin stores nothing. Tern decides what counts as seen, and a plugin reload loses no dots.

What broke

The first version drew the green dot from data-st='done', a value that Tern's plugin guide lists among its selectors. On 1 December Tern updated itself to 0.9.40 and stopped setting it, and every finished agent looked idle. Nothing in the row's markup was left to select, so the green dot moved to the unseen alert, which belongs to the plugin API and not to the page. The other three colors still read data-st and can break the same way.

Testing the release showed a second gap. A long shell command that finished in another tab stayed without a dot until the next focus change, because the handler listened to agent events and not to command_finished. The test is the shell script from the demo: it plays fake agents through Tern's status protocol, one tab per state.

Limits

  • Side tabs only. The horizontal tab bar keeps Tern's icons and badges.
  • The green dot needs the Luau half, which does not run in Tern's web client. The other colors are plain CSS and work there.
  • There is no automated test. The check after a Tern update is to run the script and look at the sidebar.
  • Tested on macOS only.

Install

In any terminal on a machine with Tern:

tern plugin install github.com/s4ff0x/tern-sidebar

Side tabs must be on: Settings › Appearance › Interface style › Tabs. To update, run the same command with --force. To remove it, run tern plugin remove tern-sidebar.

The source, the fake-agent script and the issue tracker are on GitHub. If a dot is missing after a Tern update, open an issue with your version (tern --version).

Questions about this project: [email protected]