[BUG] Notifications not delivered in VS Code integrated terminal (OSC escape sequences not processed)
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?
Claude Code does not deliver macOS desktop notifications when running inside VS Code's integrated terminal, even though the notification setting is set to Auto and macOS notification permissions are granted for VS Code.
The OSC escape sequences that Claude Code emits to trigger notifications are silently dropped by VS Code's integrated terminal — they are never forwarded to the OS as desktop notifications.
What Should Happen?
A macOS desktop notification should appear when Claude Code completes a task, regardless of which terminal emulator is being used — consistent with the behavior seen in iTerm2, Kitty, and Ghostty.
Error Messages/Logs
No error is shown. Notifications simply never appear. Running osascript directly confirms permissions are fine:
$ osascript -e 'display notification "test" with title "Claude Code"'
# Notification appears successfully
Steps to Reproduce
- Open VS Code and use the integrated terminal
- Start Claude Code with a long-running task (e.g.,
claude "summarize this large codebase") - Wait for the task to complete
- Observe: no macOS desktop notification is delivered
Note: Switching to iTerm2 with the exact same Claude Code version and settings delivers notifications correctly.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
2.1.52
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Root cause analysis: VS Code's integrated terminal does not process OSC notification escape sequences (such as OSC 9 ; 2 ; <message> ST). Native terminals like iTerm2, Kitty, and Ghostty implement these sequences and forward them as desktop notifications — VS Code does not.
This is distinct from #16114 (notification hooks failing in the VS Code extension). This issue is about the integrated terminal not delivering notifications regardless of hook configuration.
Suggested fix: Detect $TERM_PROGRAM=vscode at runtime and fall back to invoking osascript directly on macOS instead of relying on OSC sequences for notification delivery.
Workarounds (confirmed working):
- Add a notification hook in
~/.claude/settings.jsonthat invokesosascriptdirectly - Run Claude Code in iTerm2 or another OSC-compatible terminal
Related issues:
- #16114 — Notification hooks not working in VS Code extension
- #7239 — Feature request for consistent notifications across terminals
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗