mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-10-09 15:58:34 +00:00
c6bdcffb89
* feat: add dynamic terminal tab titles for shell-reported session names Follow OSC 0/2 window titles on session tabs so tools like Claude Code can show live session state, with a per-host opt-out to keep connection names instead. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: address dynamic tab title review findings Restore the missing cn import, clear dynamic titles when the shell sends an empty OSC title, and drop stored dynamic titles when a host disables the feature. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: preserve renamed session labels and align focus sidebar titles Prefer user-assigned customName over shell titles, skip no-op dynamic title updates, and use resolveSessionTabTitle in the workspace focus sidebar. Co-authored-by: Cursor <cursoragent@cursor.com> * feat: show coding agent icons on session tabs Detect Claude Code, Codex, OpenCode, Droid, and other CLIs from OSC titles and launch commands, reusing shared agent icon assets inspired by freshell pane icons. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: harden coding CLI detection across SSH and startup paths Wire output scanning through attachSessionToTerminal, seed providers from auto startup commands, prevent title signals from overriding command detection, clear sticky state on shell titles, and release output scanners on session close. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: reset CLI output scanner when provider state clears Prevent exited-agent banners from immediately re-sticking the tab icon after the shell title returns to a normal shell name. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: update sticky CLI provider when title signals a different agent Allow agent switches in the same terminal while still resetting the output scanner whenever the provider identity changes. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: avoid clearing CLI provider on blank titles and cap output scan Ignore transient empty OSC titles and stop banner scanning after 16KB of unmatched output so regular SSH sessions do not pay perpetual scan cost. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: prefer runtime CLI provider over host startup command on tabs Runtime detection from commands, output, and titles should win over static host startup commands when resolving the session tab icon. Co-authored-by: Cursor <cursoragent@cursor.com> * fix: satisfy eslint for terminal escape stripping regexes Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
105 lines
2.3 KiB
TypeScript
105 lines
2.3 KiB
TypeScript
import type { AgentIconKey } from './agentIcon';
|
|
|
|
export type CodingCliProviderId =
|
|
| 'claude'
|
|
| 'codex'
|
|
| 'opencode'
|
|
| 'gemini'
|
|
| 'kimi'
|
|
| 'droid'
|
|
| 'copilot'
|
|
| 'cursor'
|
|
| 'codebuddy';
|
|
|
|
export type CodingCliProvider = {
|
|
id: CodingCliProviderId;
|
|
label: string;
|
|
/** Primary CLI executable basename, e.g. `claude` or `codex`. */
|
|
command: string;
|
|
/** Alternate executable names that should resolve to this provider. */
|
|
aliases?: string[];
|
|
/** Substrings commonly present in OSC window titles for this CLI. */
|
|
titleHints?: string[];
|
|
iconKey: AgentIconKey;
|
|
};
|
|
|
|
/**
|
|
* Built-in coding CLI providers shown on terminal session tabs.
|
|
* Command names align with common agent launch binaries.
|
|
*/
|
|
export const CODING_CLI_PROVIDERS: readonly CodingCliProvider[] = [
|
|
{
|
|
id: 'claude',
|
|
label: 'Claude Code',
|
|
command: 'claude',
|
|
titleHints: ['claude code', 'claude'],
|
|
iconKey: 'claude',
|
|
},
|
|
{
|
|
id: 'codex',
|
|
label: 'Codex CLI',
|
|
command: 'codex',
|
|
titleHints: ['codex', 'chatgpt'],
|
|
iconKey: 'codex',
|
|
},
|
|
{
|
|
id: 'opencode',
|
|
label: 'OpenCode',
|
|
command: 'opencode',
|
|
titleHints: ['opencode'],
|
|
iconKey: 'opencode',
|
|
},
|
|
{
|
|
id: 'gemini',
|
|
label: 'Gemini CLI',
|
|
command: 'gemini',
|
|
titleHints: ['gemini'],
|
|
iconKey: 'gemini',
|
|
},
|
|
{
|
|
id: 'kimi',
|
|
label: 'Kimi CLI',
|
|
command: 'kimi',
|
|
aliases: ['moonshot'],
|
|
titleHints: ['kimi', 'moonshot'],
|
|
iconKey: 'kimi',
|
|
},
|
|
{
|
|
id: 'droid',
|
|
label: 'Droid',
|
|
command: 'droid',
|
|
aliases: ['factory'],
|
|
titleHints: ['droid', 'factory droid', 'factory ai'],
|
|
iconKey: 'droid',
|
|
},
|
|
{
|
|
id: 'copilot',
|
|
label: 'GitHub Copilot CLI',
|
|
command: 'copilot',
|
|
titleHints: ['copilot', 'github copilot'],
|
|
iconKey: 'copilot',
|
|
},
|
|
{
|
|
id: 'cursor',
|
|
label: 'Cursor Agent',
|
|
command: 'cursor',
|
|
titleHints: ['cursor'],
|
|
iconKey: 'cursor',
|
|
},
|
|
{
|
|
id: 'codebuddy',
|
|
label: 'CodeBuddy',
|
|
command: 'codebuddy',
|
|
titleHints: ['codebuddy'],
|
|
iconKey: 'codebuddy',
|
|
},
|
|
] as const;
|
|
|
|
const PROVIDER_BY_ID = new Map(
|
|
CODING_CLI_PROVIDERS.map((provider) => [provider.id, provider] as const),
|
|
);
|
|
|
|
export function getCodingCliProvider(id: CodingCliProviderId): CodingCliProvider | undefined {
|
|
return PROVIDER_BY_ID.get(id);
|
|
}
|