{"id":51820145,"url":"https://github.com/riq0h/tab-process-name","last_synced_at":"2026-07-22T04:19:50.072Z","repository":{"id":372190944,"uuid":"1305665283","full_name":"riq0h/tab-process-name","owner":"riq0h","description":null,"archived":false,"fork":false,"pushed_at":"2026-07-19T13:48:19.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-19T15:27:51.498Z","etag":null,"topics":["herdr-plugin"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/riq0h.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-07-19T11:46:58.000Z","updated_at":"2026-07-19T13:48:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/riq0h/tab-process-name","commit_stats":null,"previous_names":["riq0h/tab-process-name"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/riq0h/tab-process-name","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riq0h%2Ftab-process-name","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riq0h%2Ftab-process-name/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riq0h%2Ftab-process-name/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riq0h%2Ftab-process-name/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/riq0h","download_url":"https://codeload.github.com/riq0h/tab-process-name/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/riq0h%2Ftab-process-name/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35746914,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-22T02:00:06.236Z","response_time":124,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["herdr-plugin"],"created_at":"2026-07-22T04:19:49.448Z","updated_at":"2026-07-22T04:19:50.060Z","avatar_url":"https://github.com/riq0h.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tab-process-name\n\nA [herdr](https://herdr.dev/) plugin that labels each tab with its\nforeground process name — tmux's `automatic-rename` behavior for herdr.\n\nBefore: `1` · `2` · `3` — After: `zsh` · `nvim` · `claude`\n\nThere's deliberately no number in the label. herdr's own tab `number` is a\nmonotonically increasing id that's never reclaimed after a tab closes, and\nindexed-jump keybindings (`switch_tab = \"prefix+1..9\"`) navigate by the\ntab's position in the tab bar — a separate concept herdr gives no API to\ncontrol (no way to move/reorder a tab). Any numbering this plugin computed\nwould drift from one or the other, so the label just carries the one thing\nherdr can't show on its own: what's running there. Pair this with\n[tab-blank-number](https://github.com/riq0h/tab-blank-number) to also clear\nherdr's default numeric label — the two are designed to compose regardless\nof which one reaches a given tab first.\n\n## How it works\n\nThe plugin hooks herdr events (tab/pane created, focused, moved, closed, agent\nstatus changes, workspace focus) and, on each event, walks every workspace and\nrelabels tabs through `herdr tab rename`.\n\nA tab's process name is resolved from its focused pane (or first pane) via\n`herdr pane process-info` — the name of the pane's foreground process\n(`zsh`, `nvim`, `claude`, ...).\n\nManual renames are respected. A tab is only relabeled while its label is\nstill unclaimed — herdr's default bare number, blank (as left by\ntab-blank-number), or a label this plugin set earlier. Rename a tab to\nanything else and the plugin leaves it alone from then on; rename it back\nto a bare number or blank it to hand it back to the plugin.\n\nBecause herdr emits no event when a shell simply runs a command, a label can\nlag until the next herdr-level event (switching tabs or panes, agent status\nchanges, and so on). Source the optional [shell hook](#instant-updates-optional)\nfor instant updates instead.\n\n## Requirements\n\n- herdr `\u003e= 0.7.0`\n- [Node.js](https://nodejs.org/) 22.18 or newer on your `PATH`\n- `jq` on your `PATH` (only needed for the optional shell hook)\n\nThe plugin is a single dependency-free TypeScript file that Node runs directly\nvia [type stripping](https://nodejs.org/api/typescript.html) — there is no\nbuild step, and the code you review is exactly the code that runs.\n\n## Install\n\n```bash\nherdr plugin install riq0h/tab-process-name\n```\n\nLabels sync automatically from the next herdr event on. To force a sync:\n\n```bash\nherdr plugin action invoke riq0h.tab-process-name.sync\n```\n\nOptionally bind the sync action to a key in your herdr config:\n\n```toml\n[[keys.command]]\nkey = \"prefix+alt+n\"\ntype = \"plugin_action\"\ncommand = \"riq0h.tab-process-name.sync\"\ndescription = \"sync tab process names\"\n```\n\n## Instant updates (optional)\n\nFor labels that update the moment a command starts or finishes, source the\nbundled shell hook inside herdr panes. It renames the pane's tab directly on\nevery `preexec`/`precmd` (bypassing the manual-rename protection for that tab,\nsince running a command is the intent). Find the plugin root with\n`herdr plugin list`, then add to your shell rc:\n\n```zsh\n# ~/.zshrc\n[[ -n \"$HERDR_ENV\" ]] \u0026\u0026 source /path/to/tab-process-name/shell/hook.zsh\n```\n\nThe hook is a no-op outside herdr, so sourcing it unconditionally is also\nfine. The event-driven plugin keeps covering panes that don't run an\ninteractive shell (agents, one-off commands, other shells).\n\nOnly a zsh hook ships today; a bash equivalent (`preexec`/`PROMPT_COMMAND`)\nis a reasonable follow-up contribution.\n\n## Configuration\n\nConfiguration is optional. Create `config.json` in the plugin config\ndirectory (`herdr plugin config-dir riq0h.tab-process-name` prints the path):\n\n```json\n{\n  \"overwrite_manual\": false,\n  \"max_length\": 0\n}\n```\n\n| Key | Default | Meaning |\n| --- | --- | --- |\n| `overwrite_manual` | `false` | Relabel every tab, including tabs you renamed manually. |\n| `max_length` | `0` | Truncate labels longer than this to `max_length` characters with a trailing `…`. `0` disables truncation. |\n\n## Disable / uninstall\n\n```bash\nherdr plugin disable riq0h.tab-process-name   # keep installed, stop hooks\nherdr plugin uninstall riq0h.tab-process-name\n```\n\n## Development\n\n```bash\ngit clone https://github.com/riq0h/tab-process-name\nherdr plugin link ./tab-process-name\nherdr plugin action invoke riq0h.tab-process-name.sync\nherdr plugin log list --plugin riq0h.tab-process-name\n```\n\nThe logic lives in `sync.mts`. State lives in\n`HERDR_PLUGIN_STATE_DIR/labels.json` (the labels the plugin set, used to tell\nits own labels apart from yours). Deleting it is safe; the plugin re-adopts\ntabs whose labels are bare numbers or blank.\n\n## Credit\n\nStructure and conventions borrowed from\n[dev-shimada/herdr-auto-tab-name](https://github.com/dev-shimada/herdr-auto-tab-name),\nwhich does the same thing for working-directory-based labels instead of\nprocess names.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friq0h%2Ftab-process-name","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Friq0h%2Ftab-process-name","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Friq0h%2Ftab-process-name/lists"}