Repository navigation
Kitty graphics: t=t temporary files in /tmp are rejected on macOS
#14563
Issue DescriptionOn macOS, Kitty graphics transmissions with Ghostty compares the file's canonical path with its temp roots. On macOS kitty resolves every root ( The same logic is on A fix is on this branch. AI disclosure: I used Claude Code to find the cause, write the repro script and draft this report, which I then reviewed and edited. Expected BehaviorA Actual BehaviorThe reply is Reproduction Steps
Output on 1.3.1: Launching Ghostty with kitty-tmpfile-repro.py# Run inside Ghostty: python3 kitty-tmpfile-repro.py
# Sends a Kitty graphics t=t (temporary file) transmission for a file in
# /tmp and one in $TMPDIR, then prints each reply and whether the file
# was left behind (the terminal deletes it on success).
import base64, os, select, tempfile, termios, tty
tty_fd = os.open("/dev/tty", os.O_RDWR)
def transmit(path):
with open(path, "wb") as f:
f.write(b"\xff\x00\x00\xff") # one RGBA pixel
payload = base64.b64encode(path.encode()).decode()
os.write(tty_fd, f"\x1b_Ga=t,t=t,f=32,s=1,v=1,i=1;{payload}\x1b\\".encode())
reply = b""
while b"\x1b\\" not in reply and select.select([tty_fd], [], [], 2)[0]:
reply += os.read(tty_fd, 1024)
kept = os.path.exists(path)
if kept:
os.remove(path)
return reply, kept
paths = [
"/tmp/tty-graphics-protocol-repro",
os.path.join(tempfile.gettempdir(), "tty-graphics-protocol-repro"),
]
old = termios.tcgetattr(tty_fd)
tty.setraw(tty_fd)
try:
results = [(path, *transmit(path)) for path in paths]
finally:
termios.tcsetattr(tty_fd, termios.TCSADRAIN, old)
for path, reply, kept in results:
print(f"{path}\n reply: {reply!r}\n file left behind: {kept}")Ghostty LogsGhostty VersionOS Version InformationmacOS 15.7.4 (24G517), Apple M1 Pro (Linux only) Display ServerNone (Linux only) Desktop Environment/Window ManagerNo response Minimal Ghostty Configuration# None needed: reproduces with no config loaded (--config-default-files=false)Additional Relevant ConfigurationNo response I acknowledge that:
|
Replies: 1 comment 1 reply
|
!vouch |
!vouch