Skip to content

Conversation

@benjajaja
Copy link

@benjajaja benjajaja commented Sep 26, 2025

"VT100 with GPO (Graphics Processor Option)"

Since sixels is a "passive" feature, the 4 / GPO is usually used by modern programs to infer support for sixels.

Motivation: ratatui-image wants to detect sixel support by either having the 4 in the CSI c response or some magic env var matching, and darktile uses a generic xterm like value for $TERM, so I want darktile to return 4 here.
Fixes #346

Comment on lines 307 to 314
// We are VT100 with:
// 1: STP (Selective Erase)
// 2: AVO (Advanced Video Option)
// 3: both STP and AVO
// 4: GPO (Graphics Processor Option (sixel))
// for DA1 we'll respond ?1;2;3;4
// for DA2 we'll respond >0;0;0
response := "?1;2"
response := "?1;2;4"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, that comment is not correct. The first 1 parameter indicates that the terminal is one of the VT100 range of devices (there were a few with that ID). The second parameter is a bitfield, indicating whether it supports STP, AVO, or GPO (e.g. 2 is just AVO, while 6 would be AVO plus GPO). As far as I'm aware, GPO is not actually sixel - it was a completely different protocol which was used for graphing. And the third parameter being 4 is just a hack that some modern emulators use to indicate support for sixel - it's not technically valid, and none of the original VT100 terminals would have had that value (the VT125 used that third parameter to indicate whether a printer was connected).

I'd possibly suggest something like this:

The ?1;2 indicates that we're a VT100 with AVO.
The additional 4 parameter should convince modern apps that we also support sixel.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhh the documentation I could find (here or here) is not very clear.

So, I'll keep the comment short, just indicate why the 4 is there: so that modern apps can infer sixel support automatically.

Thanks @j4james!

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VT510 documentation that you've linked is using the "modern" device attributes encoding scheme, where the first parameter is greater than 60. The VT100 range predate that architecture, so they used a different format. This is mentioned in the DEC STD 070 documentation, on page 21 of chapter 4, under the heading "Known Deviations":

Terminals designed before this architecture was developed do not conform to the above encoding scheme. They will, however, respond to the Device Attributes request by returning a DA control with a variable length parameter string. The first parameter of this parameter string is a device-specific code in the range 1 to 59.

You can find an explanation of the VT100 encoding scheme in the various VT100 manuals, like the technical manual here: https://www.vt100.net/docs/vt100-tm/appendixa.html

Just search for "Device Attributes". And if you search for "VT105" on that page, you'll also find the operations for using the graphics processor: DECGON and DECGOFF. If you're interested in the full details of the VT105 protocol, you'll need to look for a VT105 manual (I think there's a PDF of the technical manual available somewhere).

"VT100 with GPO (Graphics Processor Option)"

Since sixels is a "passive" feature, the 4 / GPO is usually used by
modern programs to infer support for sixels.
Copy link

@j4james j4james left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Although I think this project may have been abandoned, so I suspect we won't see this merged anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSI c Device Attributes Report should include 4 to indicate sixel support.

2 participants