Workflow / 使用场景
I usually keep several tabs running Claude Code (or Codex) side by side, often in the same repository. The sidebar labels them all by the working-directory name, so four tabs read pebrel, pebrel, pebrel, pebrel and I have to hover each one to find the task I want.
我常同时开几个 Claude Code / Codex 标签,而且经常在同一个仓库里。侧栏按工作目录命名,于是四个标签都叫 pebrel,要逐个悬停才知道哪个是哪个任务。
What already exists / 现状
These agents already report a task title through OSC 0/2 — Claude Code sends e.g. ✳ Fix login regression (the leading glyph animates while it works). Pebrel receives it and shows it in the tab tooltip (Claude Code · Fix login regression), but the label itself stays the directory name (tab_identity.rs, tab_label()).
I understand this is deliberate: a remote directory or program title must not replace a saved SSH host name (#164), and local tabs use their directory rather than arbitrary program titles.
这些 agent 本来就会通过 OSC 0/2 上报任务标题(Claude Code 发 ✳ 修复登录回归,工作时前面的字形会转动)。Pebrel 已经收到并放进了悬停提示,但标签名仍是目录名。我理解这是有意的设计:远端目录或程序标题不能顶掉已保存的 SSH 主机名(#164),本地标签也不该随便采用程序标题。
Proposal / 建议
Only while a recognised AI agent (AgentKind::parse) runs in a local pane, label the tab with that agent's reported title:
- strip the leading status glyph so the label does not flicker with the spinner;
- fall back to the directory name when the agent only names itself (
✳ Claude Code), and as soon as the agent exits;
- leave SSH tabs, custom names and every other program untouched;
- the tooltip keeps the directory and agent name without repeating the title.
仅当本地 pane 里运行的是已识别的 AI agent 时,用它上报的标题作标签名:去掉开头的状态字形;agent 只报自己名字或退出后回到目录名;SSH 标签、自定义名称和其他程序都不受影响。
Implementation / 实现
I have this working on my machine in a small change to terminal/view/tab_identity.rs (+ updated test in startup_tests.rs), on top of current main:
main...linjunsu:pebrel:feat/agent-session-tab-title
我本地已经实现并在用,改动集中在 tab_identity.rs,基于当前 main 的分支见上面的链接。
Would you accept this as a PR? If you would rather keep the current default, I can put it behind a setting (off by default) instead.
是否愿意接受这个 PR?如果希望保持现有默认行为,我也可以改成一个默认关闭的设置项。
Workflow / 使用场景
I usually keep several tabs running Claude Code (or Codex) side by side, often in the same repository. The sidebar labels them all by the working-directory name, so four tabs read
pebrel,pebrel,pebrel,pebreland I have to hover each one to find the task I want.我常同时开几个 Claude Code / Codex 标签,而且经常在同一个仓库里。侧栏按工作目录命名,于是四个标签都叫
pebrel,要逐个悬停才知道哪个是哪个任务。What already exists / 现状
These agents already report a task title through OSC 0/2 — Claude Code sends e.g.
✳ Fix login regression(the leading glyph animates while it works). Pebrel receives it and shows it in the tab tooltip (Claude Code · Fix login regression), but the label itself stays the directory name (tab_identity.rs,tab_label()).I understand this is deliberate: a remote directory or program title must not replace a saved SSH host name (#164), and local tabs use their directory rather than arbitrary program titles.
这些 agent 本来就会通过 OSC 0/2 上报任务标题(Claude Code 发
✳ 修复登录回归,工作时前面的字形会转动)。Pebrel 已经收到并放进了悬停提示,但标签名仍是目录名。我理解这是有意的设计:远端目录或程序标题不能顶掉已保存的 SSH 主机名(#164),本地标签也不该随便采用程序标题。Proposal / 建议
Only while a recognised AI agent (
AgentKind::parse) runs in a local pane, label the tab with that agent's reported title:✳ Claude Code), and as soon as the agent exits;仅当本地 pane 里运行的是已识别的 AI agent 时,用它上报的标题作标签名:去掉开头的状态字形;agent 只报自己名字或退出后回到目录名;SSH 标签、自定义名称和其他程序都不受影响。
Implementation / 实现
I have this working on my machine in a small change to
terminal/view/tab_identity.rs(+ updated test instartup_tests.rs), on top of currentmain:main...linjunsu:pebrel:feat/agent-session-tab-title
我本地已经实现并在用,改动集中在
tab_identity.rs,基于当前main的分支见上面的链接。Would you accept this as a PR? If you would rather keep the current default, I can put it behind a setting (off by default) instead.
是否愿意接受这个 PR?如果希望保持现有默认行为,我也可以改成一个默认关闭的设置项。