{"record":{"id":"6dc272eaea61fa63","repo":"kovidgoyal/kitty","slug":"the-mime-type-s-for-s-not-available-on-the-clipb","errorCode":null,"errorMessage":"The MIME type %s for %s not available on the clipboard","messagePattern":"The MIME type (.+?) for (.+?) not available on the clipboard","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/clipboard/read.go","lineNumber":185,"sourceCode":"\t}\n\tif images.EncodableImageTypes[self.mime_type] {\n\t\tfor _, mt := range available_mimes {\n\t\t\tif images.DecodableImageTypes[mt] {\n\t\t\t\tself.remote_mime_type = mt\n\t\t\t\tself.image_needs_conversion = true\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\tif is_textual_mime(self.mime_type) {\n\t\tfor _, mt := range available_mimes {\n\t\t\tif mt == \"text/plain\" {\n\t\t\t\tself.remote_mime_type = mt\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\treturn fmt.Errorf(\"The MIME type %s for %s not available on the clipboard\", self.mime_type, self.arg)\n}\n\nfunc escape_metadata_value(k, x string) (ans string) {\n\tif k == \"mime\" {\n\t\tx = base64.StdEncoding.EncodeToString(utils.UnsafeStringToBytes(x))\n\t}\n\treturn x\n}\n\nfunc unescape_metadata_value(k, x string) (ans string) {\n\tif k == \"mime\" {\n\t\tb, err := base64.StdEncoding.DecodeString(x)\n\t\tif err == nil {\n\t\t\tx = string(b)\n\t\t}\n\t}\n\treturn x\n}","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/clipboard/read.go#L167-L203","documentation":"assign_mime_type walks the available MIME types on the clipboard (including aliases) looking for the requested type, with a fallback to text/plain when a text type is requested. If nothing matches, it reports that the requested MIME type for the given argument is not available on the clipboard.","triggerScenarios":"`kitten clipboard get --mime image/png` when the clipboard only holds text/plain; requesting a specific type after the sender copied a different format; alias map (from --alias) not covering the format actually present.","commonSituations":"Copying from apps that register custom MIME types (e.g. text/x-custom) then requesting the standard one without an --alias; racing: reading the clipboard after its owner replaced the content with a different format; assuming image data is present when only text was copied.","solutions":["List what is actually available first: `kitten clipboard get` with no --mime prints/uses available types, or inspect the DATA status","Add an alias mapping: `--alias image/bmp=image/png` if the source uses a related format","Copy the data again on the sender in the format you need (e.g. copy image, not text)","Request text/plain, which falls back across text types"],"exampleFix":"# before\nkitten clipboard get --mime image/png out.bin   # clipboard holds text only\n# after\nkitten clipboard get --mime text/plain out.txt","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"kitten clipboard get --mime image/png out 2>/dev/null || kitten clipboard get --mime text/plain out.txt","preventionTips":["Query available types before requesting a specific one","Register --alias mappings for non-standard source formats","Handle the not-available error by degrading to text/plain"],"tags":["kitty","clipboard","mime-type","content-negotiation"],"backgroundTag":"unsupported-mime-type","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}