Skip to content

OSC52 no longer works after invalid base64 string #7757

@scturtle

Description

@scturtle

Describe the bug
OSC52 no longer works after invalid base64 string.

To Reproduce

#include <stdio.h>
#include <stdlib.h>
int main() {
    FILE *tty = fopen("/dev/tty", "w");
    const char *hello = "\e]52;c;aGVsbG8=\a";
    fputs(hello, tty); fflush(tty);
    const char *invalid = "\e]52;c;!\a"; // invalid
    fputs(invalid, tty); fflush(tty);
    const char *world = "\e]52;c;d29ybGQ=\a";
    fputs(world, tty); fflush(tty);
}

After running the above code, clipboard is world in kitty 0.35.2 but hello in kitty 0.36.0(and nightly).

Screenshots

0.36.0:
image

0.35.2:
image

Environment details

MacOS 14.6.1

Additional context

This happens because of emacs package clipetty's following hack (using an invalid base64 string to reset the clipboard).

So it may not be kitty's fault but it may be an regression.

https://github.com/spudlyo/clipetty/blob/01b39044b9b65fa4ea7d3166f8b1ffab6f740362/clipetty.el#L158-L163

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions