herdr-session-title-name: terminal_title_stripped → tab persistence
Herdr has a new plugin: herdr-session-title-name — it persists terminal_title_stripped as the tab label so hermes --tui -c "hey what is 1 plus 1" shows as session_title on top and stays as the tab name after the session closes.
Repo: github.com/jovylle/herdr-session-title-name · Live: herdr-session-title-name.uft1.com · herdr-session-title-name.pages.dev
The problem it solves
Hermes (and other agents) set the terminal title via OSC \033]0;…\007. Herdr already exposes that as terminal_title_stripped for the sidebar (⠋ hey… → hey…), but tabs are numeric by default (1, 2…) and manual names like DASH/HUB shouldn't be overwritten. The title vanished when the session exited — no tab persistence.
What it does
- Sidebar
session_titlealone on top — builtinterminal_title_stripped, no$session_name. - Tab persistence — numeric tabs (
1,2…) auto-rename to that stripped title. Manual names (DASH,HUB,github/jovylle) are respected and never touched. - No fork — pure plugin for upstream herdr 0.8.2+, repurposed from the deprecated
herdr-session-name($session_nameapproach).
Demo:
hermes --tui -c "hey what is 1 plus 1"
# sidebar top: hey what is 1 plus 1 (terminal_title_stripped)
# tab bar: 1 → hey what is 1 plus 1 (after ~1.5s)
# exit hermes — tab stays hey what is 1 plus 1
How it works (no fork needed)
Herdr plugins can't hook terminal_title directly (PaneUpdated not in PLUGIN_HOOK_EVENT_KINDS), so the plugin uses two paths:
- Event hooks —
tab.created,pane.created,pane.focused,tab.focused,pane.exited→sync.shfetchesherdr api snapshot, finds each numeric tab's focused paneterminal_title_stripped, renames viaherdr tab renameif needed. - Startup poller —
watch.shloops every 1.5s calling the same sync, catching OSC title changes fromhermes --tui -cthat don't fire an event. Only^[0-9]+$labels are touched.
Sidebar config (herdr native — no plugin config needed):
# untouched config — title alone on top
[ui.sidebar.agents]
rows = [["terminal_title_stripped"]]
# if you already have [ui.sidebar.agents], prepend it:
[ui.sidebar.agents]
rows = [
["terminal_title_stripped"],
["agent"],
["state_icon", "workspace"],
[{ token = "tab", fg = "#101010" }]
]
Install
herdr plugin install jovylle/herdr-session-title-name --yes
herdr plugin list
herdr server reload-config
herdr plugin log list --plugin jovylle.session-title-name
Local dev link: herdr plugin link /lab/herdr-session-title-name (after herdr plugin unlink jovylle.session-name).
Repurposed
Renamed from herdr-session-name (which used $session_name + session_title alias via fork) → herdr-session-title-name at /lab/herdr-session-title-name. Fork at /lab/herdr-fork left clean for upstream contributions.