{"record":{"id":"be039468a919d0cf","repo":"kovidgoyal/kitty","slug":"failed-to-convert-image-data-output-file-s-to-ab","errorCode":null,"errorMessage":"Failed to convert image data output file: %s to absolute path with error: %w","messagePattern":"Failed to convert image data output file: (.+?) to absolute path with error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/icat/transmit.go","lineNumber":130,"sourceCode":"\t\t}\n\t\tcopy(mmap.Slice(), frame.in_memory_bytes)\n\t}\n\tdefer mmap.Close() // terminal is responsible for unlink\n\tgc := gc_for_image(imgd, frame_num, frame)\n\tgc.SetTransmission(graphics.GRT_transmission_sharedmem)\n\tgc.SetDataSize(uint64(data_size))\n\terr = gc.WriteWithPayloadTo(os.Stdout, utils.UnsafeStringToBytes(mmap.Name()))\n\treturn\n}\n\nfunc transmit_file(imgd *image_data, frame_num int, frame *image_frame) (err error) {\n\tis_temp := false\n\tfname := \"\"\n\tvar data_size int\n\tif frame.in_memory_bytes == nil {\n\t\tfname, err = filepath.Abs(frame.filename)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to convert image data output file: %s to absolute path with error: %w\", frame.filename, err)\n\t\t}\n\t\tframe.filename = \"\" // so it isn't deleted in cleanup\n\t} else {\n\t\tis_temp = true\n\t\tf, err := images.CreateTempInRAM()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to create a temp file for image data transmission: %w\", err)\n\t\t}\n\t\tdata_size = len(frame.in_memory_bytes)\n\t\t_, err = bytes.NewBuffer(frame.in_memory_bytes).WriteTo(f)\n\t\tf.Close()\n\t\tif err != nil {\n\t\t\tos.Remove(f.Name())\n\t\t\treturn fmt.Errorf(\"Failed to write image data to temp file for transmission: %w\", err)\n\t\t}\n\t\tfname = f.Name()\n\t}\n\tgc := gc_for_image(imgd, frame_num, frame)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/icat/transmit.go#L112-L148","documentation":"In file-based transmission, icat converts the frame's filename to an absolute path via filepath.Abs before telling the terminal to read it; that conversion failed.","triggerScenarios":"filepath.Abs errors are rare in Go (getwd failures) — e.g. the process's working directory was deleted while icat ran.","commonSituations":"Running icat from a directory that gets removed mid-run; exotic sandboxes where getwd is unavailable.","solutions":["Run icat from a stable working directory","Pass absolute paths for image files","If reproducible, report a kitty bug with the environment details"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, err := os.Getwd(); err != nil { /* chdir to a stable dir before running icat */ }","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"absolute path\") { /* re-run from a valid cwd with absolute image paths */ }","preventionTips":["Invoke icat with absolute image paths","Avoid running from directories that may be deleted"],"tags":["kitty","icat","filesystem","paths"],"backgroundTag":"path-resolution-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}