Skip to content

[BUG] OSC-99 (desktop notifications) support is hard-codedly assumed rather than queried #40165

@imsnif

Description

@imsnif

Preflight Checklist

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

What's Wrong?

Claude Code isn't querying the terminal for OSC99 support (desktop notifications), but rather (I assume from testing) hard-codedly assumes certain terminals or environments have or don't have support for it.

What Should Happen?

Claude Code should query the terminal for support as the protocol specifies: https://sw.kovidgoyal.net/kitty/desktop-notifications/#querying-for-support

Error Messages/Logs

Steps to Reproduce

Umm... not trivial, but sure:

  1. Start Claude Code inside a PTY environment you control (I'm using zellij). And log all ANSI instructions received from the pane running Claude Code
  2. Note that the query string described in https://sw.kovidgoyal.net/kitty/desktop-notifications/#querying-for-support is not received
  3. If above environment from 1 is started in a terminal that supports desktop notifications (eg. Kitty), the desktop notifications are sent anyway, if it starts in a terminal that does not support them (eg. Alacritty) the desktop notifications are not sent. I assume this is also the case for terminals that might support them but Claude doesn't hard-codedly know about

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.86 (Claude Code)

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Hi Anthropic 👋

I'm a Zellij maintainer. I was asked by many users to add support for Desktop Notifications so that they can pass through Zellij to the host terminal when they're using Claude Code.

While I recently implemented them so that they work out of the box with Zellij, I was disappointed to find out that with Claude Code they will only work with terminals that support them. This seems to happen (as described above) because Claude Code doesn't query the terminal for support, but rather assumes support or lack thereof based on the detected terminal.

This is unfortunate, seeing as Zellij has the ability to make them work out of the box in any terminal by proxying them to supported tools on the user's machine. But this won't work unless Claude complies to the protocol.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:tuibugSomething isn't workingplatform:linuxIssue specifically occurs on LinuxstaleIssue is inactive

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions