Download packages/app/src/pages/session/terminal-label.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 613 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/terminal-label.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/app/src/pages/session/terminal-label.ts
-
curl -L -o terminal-label.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/app/src/pages/session/terminal-label.ts
613 Bytes
| import { isDefaultTitle as isDefaultTerminalTitle } from "@/context/terminal-title" | |
| export const terminalTabLabel = (input: { | |
| title?: string | |
| titleNumber?: number | |
| t: (key: string, vars?: Record<string, string | number | boolean>) => string | |
| }) => { | |
| const title = input.title ?? "" | |
| const number = input.titleNumber ?? 0 | |
| const isDefaultTitle = Number.isFinite(number) && number > 0 && isDefaultTerminalTitle(title, number) | |
| if (title && !isDefaultTitle) return title | |
| if (number > 0) return input.t("terminal.title.numbered", { number }) | |
| if (title) return title | |
| return input.t("terminal.title") | |
| } | |