From 9b29654e9017aba6f8b28a8a7fc5ff8466defe4a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Aug 2026 15:49:38 +0530 Subject: [PATCH] clarify behavior of leading and trailing commas in the graphics protocol --- docs/graphics-protocol.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/graphics-protocol.rst b/docs/graphics-protocol.rst index 405788c4f..adae5c293 100644 --- a/docs/graphics-protocol.rst +++ b/docs/graphics-protocol.rst @@ -254,10 +254,12 @@ All graphics escape codes are of the form:: This is a so-called *Application Programming Command (APC)*. Most terminal emulators ignore APC codes, making it safe to use. -The control data is a comma-separated list of ``key=value`` pairs. The payload -is arbitrary binary data, :rfc:`base64 <4648>` encoded to prevent interoperation problems -with legacy terminals that get confused by control codes within an APC code. -The meaning of the payload is interpreted based on the control data. +The control data is a comma-separated list of ``key=value`` pairs, trailing or +leading commas are undefined implementations may ignore them or reject the +escape code entirely. The payload is arbitrary binary data, :rfc:`base64 +<4648>` encoded to prevent interoperation problems with legacy terminals that +get confused by control codes within an APC code. The meaning of the payload is +interpreted based on the control data. The first step is to transmit the actual image data.