Iterm2’s image protocol never really had a official way to query support for it, requiring to check TERM_PROGRAM environment variable (or in Konsole’s case just guessing, as it does not have that) or using way less implemented \x1b[1337n control sequence.
But now iterm2 has published a official(ish) way to query support for the image protocol, among other features, via the Terminal Feature Reporting sequence.
Note that this is a iterm2 proprietary implementation originally proposed in freedesktop: terminal-wg but has been stale for some years.
Also note that this has been around in iterm2 since early in 2022, but had been undocumented until recently.
I would like this to be either fully implemented or at least advertise FILE(F) support to be able to consistently query support for the image protocol.
Example usage would be:
Client: \x1b]1337;Capabilities\x1b\\
Terminal Response: \x1b]1337;Capabilities=FEATURES\x1b\\
Where FEATURES is capital letter delimited, with lowercase being possible (like Sx for Sixel) and optional numbers for features that take them. (ex T1CwMUBSxF)
Also see it2caps script and this comment.
iterm2: Feature request: detection of inline image support #10236
PS: until just before creating this, i didnt even know konsole supported the iterm2 protocol (though i knew about kitty and sixel support) due to not being able to query for it.