kovidgoyal/kitty · error

Failed to convert image data output file: %s to absolute pat

Error message

Failed to convert image data output file: %s to absolute path with error: %w

What it means

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.

Source

Thrown at kittens/icat/transmit.go:130

		}
		copy(mmap.Slice(), frame.in_memory_bytes)
	}
	defer mmap.Close() // terminal is responsible for unlink
	gc := gc_for_image(imgd, frame_num, frame)
	gc.SetTransmission(graphics.GRT_transmission_sharedmem)
	gc.SetDataSize(uint64(data_size))
	err = gc.WriteWithPayloadTo(os.Stdout, utils.UnsafeStringToBytes(mmap.Name()))
	return
}

func transmit_file(imgd *image_data, frame_num int, frame *image_frame) (err error) {
	is_temp := false
	fname := ""
	var data_size int
	if frame.in_memory_bytes == nil {
		fname, err = filepath.Abs(frame.filename)
		if err != nil {
			return fmt.Errorf("Failed to convert image data output file: %s to absolute path with error: %w", frame.filename, err)
		}
		frame.filename = "" // so it isn't deleted in cleanup
	} else {
		is_temp = true
		f, err := images.CreateTempInRAM()
		if err != nil {
			return fmt.Errorf("Failed to create a temp file for image data transmission: %w", err)
		}
		data_size = len(frame.in_memory_bytes)
		_, err = bytes.NewBuffer(frame.in_memory_bytes).WriteTo(f)
		f.Close()
		if err != nil {
			os.Remove(f.Name())
			return fmt.Errorf("Failed to write image data to temp file for transmission: %w", err)
		}
		fname = f.Name()
	}
	gc := gc_for_image(imgd, frame_num, frame)

View on GitHub (pinned to 6d5d0c4406)

Solutions

  1. Run icat from a stable working directory
  2. Pass absolute paths for image files
  3. If reproducible, report a kitty bug with the environment details
Defensive patterns

Strategy: validation

Validate before calling

if _, err := os.Getwd(); err != nil { /* chdir to a stable dir before running icat */ }

Try / catch

if err != nil && strings.Contains(err.Error(), "absolute path") { /* re-run from a valid cwd with absolute image paths */ }

Prevention

When it happens

Trigger: filepath.Abs errors are rare in Go (getwd failures) — e.g. the process's working directory was deleted while icat ran.

Common situations: Running icat from a directory that gets removed mid-run; exotic sandboxes where getwd is unavailable.

Related errors


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/be039468a919d0cf. Report an issue: GitHub.