#15882·warp

在替代屏幕应用程序中,鼠标事件会丢失在覆盖了小猫图形图像的单元中

作者: rchougule创建于 2026年9月9日更新于 2026年9月16日
标签bugtriagedrepro:highos:macarea:shell-terminalarea:ui-frameworkarea:terminal-inputwarp:auto-triage-review
repro.py
python
#!/usr/bin/env python3
"""
Minimal reproduction: Warp swallows ALL mouse reports for cells covered by a
kitty-graphics image placement.
Run it in Warp (needs Pillow): python3 repro.py
Then follow the on-screen instructions with a real mouse/trackpad.
Expected (correct) behaviour, as in kitty/WezTerm/Ghostty: every scroll notch and
click prints a report line, whether or not it lands on the image.
Observed in Warp 0.2026.07.22.09.01.01: reports stop entirely while the pointer is
inside the image rectangle, and resume the moment it leaves it or the image is deleted.
"""
import base64, io, os, re, select, sys, termios, tty
def png(w, h):
    from PIL import Image
    im = Image.new("RGBA", (w, h), (0, 0, 0, 0))          # fully transparent interior
    for x in range(w):
        im.putpixel((x, 0), (255, 0, 0, 200)); im.putpixel((x, h - 1), (255, 0, 0, 200))
    for y in range(h):
        im.putpixel((0, y), (255, 0, 0, 200)); im.putpixel((w - 1, y), (255, 0, 0, 200))
    b = io.BytesIO(); im.save(b, "PNG"); return base64.standard_b64encode(b.getvalue()).decode()
o = sys.stdout
def w(s): o.write(s); o.flush()
fd = sys.stdin.fileno(); old = termios.tcgetattr(fd); tty.setraw(fd)
w("\x1b[?1049h\x1b[2J\x1b[H\x1b[?1000h\x1b[?1006h")     # alt screen + SGR mouse
try:
    for i in range(1, 25):
        w("row %02d %s\r\n" % (i, png(80, 10)))
…

内容来源: warpdotdev/warp