fix(coding-agent): respected session title source when formatting terminal titles

- Propagated session title source through terminal-title update calls so auto and user names are handled consistently across controllers.
- Suppressed auto-generated names in status-line segments and completion messages by falling back to cwd-based titles.
- Updated title formatter tests to verify auto-generated and user-specified session titles produce different terminal labels.
This commit is contained in:
can1357
2026-04-13 06:22:37 +02:00
parent f1cb3d8121
commit 11b7ba7846
9 changed files with 61 additions and 14 deletions
@@ -588,7 +588,11 @@ export class CommandController {
}
await this.ctx.session.newSession();
this.ctx.resetObserverRegistry();
setSessionTerminalTitle(this.ctx.sessionManager.getSessionName(), this.ctx.sessionManager.getCwd());
setSessionTerminalTitle(
this.ctx.sessionManager.getSessionName(),
this.ctx.sessionManager.getCwd(),
this.ctx.sessionManager.titleSource,
);
this.ctx.statusLine.invalidate();
this.ctx.statusLine.setSessionStartTime(Date.now());
@@ -695,7 +699,7 @@ export class CommandController {
return;
}
const name = this.ctx.sessionManager.getSessionName()!;
setSessionTerminalTitle(name, this.ctx.sessionManager.getCwd());
setSessionTerminalTitle(name, this.ctx.sessionManager.getCwd(), this.ctx.sessionManager.titleSource);
this.ctx.statusLine.invalidate();
this.ctx.updateEditorBorderColor();
this.ctx.showStatus(`Session renamed to "${name}".`);