claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Terminal title escape sequences not passed through to terminal emulator

Open avinden opened this issue 11 months ago • 1 comments

Problem

When running terminal title escape sequences via the Bash tool, they are captured as text output rather than being interpreted by the terminal emulator.

Example command:

printf '\033]0;Claude - MCP setup\007'

Expected: VS Code terminal tab updates to "Claude - MCP setup" Actual: Output shows ]0;Claude - MCP setup as text, terminal title unchanged

Use Case

Users may want to set descriptive terminal tab names based on the current task (e.g., "Claude: Fix auth bug", "Claude: Review PR") for better session organization when multiple terminals are open.

Root Cause

Claude Code executes bash commands in a subprocess and captures stdout. Terminal escape sequences (OSC codes) require direct TTY access to be interpreted by the terminal emulator.

Proposed Solutions

  1. Detect and forward OSC sequences: Parse captured output for OSC escape sequences (specifically \033]0;...\007 for title) and forward them to the parent terminal
  2. Add native terminal title API: Provide a mechanism for Claude to set terminal title directly, e.g., via a config option or dedicated command
  3. PTY passthrough mode: Option to run certain commands with direct PTY access instead of captured subprocess

Environment

  • Claude Code v2.0.75
  • VS Code integrated terminal
  • macOS Darwin 24.6.0

avinden avatar Dec 22 '25 19:12 avinden

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/8834
  2. https://github.com/anthropics/claude-code/issues/9881
  3. https://github.com/anthropics/claude-code/issues/12239

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 22 '25 19:12 github-actions[bot]

This issue has been automatically closed as a duplicate of #8834.

If this is incorrect, please re-open this issue or create a new one.

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 26 '25 09:12 github-actions[bot]

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Jan 02 '26 14:01 github-actions[bot]