Terminal title: distinguish "idle with background tasks running" from truly idle

Open 💬 0 comments Opened Jul 2, 2026 by jhoblitt

Description

Claude Code sets the terminal window/tab title to * <session name> when the session is awaiting user input. However, "awaiting input" includes the state where background work is still in flight — background Bash commands (run_in_background), background agents/subagents, and workflows. From the window manager's perspective these two states look identical, so when running multiple sessions I can't tell which windows are fully quiesced and which still have work running that will re-invoke the model when it finishes.

Current behavior

  • Turn active: spinner/task description in the title
  • Awaiting input, background tasks still running: * <session name>
  • Awaiting input, nothing running: * <session name> (indistinguishable from above)

Requested behavior

Use a distinct meta-character/indicator for "awaiting input but background tasks are running", for example:

  • * my-session — truly idle
  • & my-session (or , %, *+, etc.) — idle at the prompt, but background tasks still running

Even better would be including the count, e.g. & my-session (2).

Why a workaround doesn't exist

  • The only related control is CLAUDE_CODE_DISABLE_TERMINAL_TITLE=1, which is all-or-nothing.
  • Hooks can emit OSC title escapes, but no hook event or payload exposes background-task state, so users can't build this indicator themselves.

Alternative that would also solve it

Expose background-task state (running count) to hooks and/or the statusline input JSON, plus a terminalTitle format string — then users could compose any indicator they want.

Related closed requests for title configurability: #27221, #29310, #21677, #23355 — this differs from those in that it's about a state the title currently conflates, not just format preference.

Environment

Claude Code CLI on Linux (Fedora 42), terminal emulator picks up OSC 0/2 titles.

View original on GitHub ↗