[BUG] /terminal-setup fails in Apple Terminal due to checking $TERM instead of $TERM_PROGRAM

Open 💬 0 comments Opened Jun 25, 2026 by osdtinubu

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Running /terminal-setup inside Claude Code on macOS Apple Terminal produces the error:

Terminal setup cannot be run from xterm-256color.

Apple Terminal is listed as a supported terminal for this command, but the detection logic appears to check $TERM (which Apple Terminal sets to xterm-256color) rather than $TERM_PROGRAM (which correctly identifies the terminal as Apple_Terminal).

What Should Happen?

The command recognizes Apple Terminal as a supported terminal and proceeds with Shift+Enter shortcut setup.

Error Messages/Logs

Terminal setup cannot be run from xterm-256color.

Steps to Reproduce

  1. Open Apple Terminal on macOS
  2. Launch Claude Code (claude)
  3. Run /terminal-setup

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

Claude Code v2.1.191

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

macos:
ProductVersion: 26.5.1
BuildVersion: 25F80

  • Terminal: Apple Terminal
  • $TERM: xterm-256color
  • $TERM_PROGRAM: Apple_Terminal

Check $TERM_PROGRAM in addition to (or instead of) $TERM when detecting Apple Terminal. Apple Terminal always sets TERM_PROGRAM=Apple_Terminal regardless of the $TERM value.

View original on GitHub ↗