-
-
Notifications
You must be signed in to change notification settings - Fork 115
CSI c Device Attributes Report returns 4 to indicate sixel support
#347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // 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" |
There was a problem hiding this comment.
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;2indicates that we're a VT100 with AVO.
The additional4parameter should convince modern apps that we also support sixel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
j4james
left a comment
There was a problem hiding this 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.
"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
4in theCSI cresponse or some magic env var matching, and darktile uses a genericxtermlike value for$TERM, so I want darktile to return4here.Fixes #346