# Terminal ID header A pane header that shows each terminal's address, such as `t16`, in front of its title. It's the value of `$HC_TERMINAL_ID` in that terminal, so you can tell an agent or an `hc` command which terminal you mean without running `env`. ![Terminal ID header](preview.png) This file is the brief: enough to build Terminal ID header from an empty folder. The files next to it are one build of it. If they don't work on your Herdr, or you want it different, build it again from here. ## What you see One header on each framed pane, as a single row, left to right: - The program's icon, 15–16px, when Herdr knows one. - The terminal's address, such as `t16`, in the theme's `dim` color. - The terminal's title, semibold and at most 320px wide, truncated after that. It uses `foreground` while the pane has focus and `muted` otherwise. With no title it says "shell". - The folder in `dim`, shortened with `~`. It fills the remaining width and is hidden when the title already shows the folder or starts with `~` or `/`. - Four 15px icon buttons on the right: split right, split down, zoom or unzoom, close. They use `dim`, and `foreground` on a `hover` background when hovered. Text is 14px, with 12px padding on the left, 8px on the right and 8px gaps. The header has no background of its own. The layout sets its height. ## How it behaves - Clicking the header focuses the pane. - The buttons run `pane.split` (right or down), `pane.zoom` and `pane.close` on that pane. Clicks on them don't also focus it through the header. - The address follows the terminal shown in the pane. Mod panes have no terminal, so they show no address. - Agent status isn't shown: working, blocked, done and idle all look the same here. - Nothing is animated, and there are no keys. ## Built from - **One mod**, `mods/terminal-id-header/`, with `main.js`, `mod.json` (`place: "none"`) and its five icons: `split-right`, `split-down`, `zoom`, `unzoom` and `close`. - **`herdr` functions:** `panes()` (finding its own entry by `props().pane`), `props()`, `run()`, `home()` and `theme()`. The address is `terminal` on that entry. - **`gpui-kit` and `gpui-base`:** `View`, `div`, `svg`, `image` and `h_flex`. - **No programs, network or file access.** - **Based on** Herdr's shipped `terminals-pane` mod, under the Apache License 2.0. A repo for a mod can't include a layout, so add the header to your own. It takes the mod plus one change: your layout's tab block has to use it as the pane header. ```json { "tab": "active", "pane": { "header": { "content": { "mod": "terminal-id-header" }, "height": 38 }, "lone": true } } ``` `lone: true` also gives a tab's only pane a header. Herdr's shipped layouts are read-only, so if you're on one, run `layout.clone` and edit the clone. ## Watch out - The header replaces whatever your layout uses now, so you lose anything that header showed. Compared with the shipped `pane` mod, that includes the agent status. - If you edit the shipped layout file directly, the next start moves your edit aside and restores Herdr's version. - Icon paths in `main.js` include the mod's folder name. If you rename the folder, change them too. - Colors come from `theme()`. A layout with its own hard-coded look may still set a different pane background. ## Done when - `herdr-app check mods/terminal-id-header` passes. - `herdr-app status` shows no errors after your layout points at the mod. - In a terminal, `echo $HC_TERMINAL_ID` prints the address shown in that pane's header, and it matches the `terminal` for that pane in `herdr-app ls`. - The split, zoom and close buttons act on the pane they belong to.