[BUG] CLAUDE_CODE_DISABLE_TERMINAL_TITLE is ignored for background sessions, and the session name can be "[Request interrupted by user]"
Summary
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1 correctly suppresses terminal title writes in a normal interactive session, but has no effect when the session is a background agent (--bg). The tab title gets overwritten with the value of CLAUDE_CODE_SESSION_NAME.
Separately, that auto-generated session name can be an internal marker string rather than a description of the task. Mine was literally [Request interrupted by user], which is what landed in my tab title.
Environment
- Claude Code 2.1.224
- Linux Mint 22.3, kernel 7.0.0-28-generic
- GNOME Terminal 3.52.0, VTE 0.76.0
Steps to reproduce
export CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1- Set your own tab title, e.g.
printf '\e]0;mytitle\7' - Start a background session
- Interrupt a request mid-turn, then send another prompt
- The tab title becomes
[Request interrupted by user]
Evidence
Environment of the running process, with the disable flag clearly set:
CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1
CLAUDE_CODE_ENTRYPOINT=cli
CLAUDE_CODE_SESSION_KIND=bg
CLAUDE_CODE_SESSION_NAME=[Request interrupted by user]
Expected
With CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1, no title writes at all, whatever the session kind. And the session auto-namer should never fall back to [Request interrupted by user], which reads as an error to the user.
Notes
There is no terminal-side workaround. GNOME Terminal dropped its old "keep initial title" option, and the profile schema (org.gnome.Terminal.Legacy.Profile) has no title keys at all. claude --help shows no --name flag for background sessions, so the bad auto-name cannot be overridden either.
Related but distinct: #76092 asks for such a setting to be added, apparently unaware CLAUDE_CODE_DISABLE_TERMINAL_TITLE already exists. This report is about the existing setting being ignored in --bg sessions.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗