@@ -108,3 +108,62 @@ creating links, etc. If any errors occur it responds with an error message,
108108such as::
109109
110110 ← action=status id=someid status=Some error occurred
111+
112+
113+ Encoding of transfer commands as escape codes
114+ ------------------------------------------------
115+
116+ Transfer commands are encoded as OSC escape codes of the form::
117+
118+ <OSC> 5113 ; key=value ; key=value ... <ST>
119+
120+ Here ``OSC `` is the bytes ``0x1b 0x5d `` and ``ST `` is the bytes
121+ ``0x1b 0x5c ``. Keys are words containing only the characters ``[a-zA-Z0-9_] ``
122+ and ``value `` is arbitrary data, whose encoding is dependent on the value of
123+ ``key ``. Unknown keys **must ** be ignored when decoding a command.
124+ The number ``5113 `` is a constant and is unused by any known OSC codes. It is
125+ the numeralization of the word ``file ``.
126+
127+
128+ .. table :: The keys and value types for this protocol
129+ :align: left
130+
131+ ================= ======== ============== =======================================================================
132+ Key Key name Value type Notes
133+ ================= ======== ============== =======================================================================
134+ action ac Enum send, file, data, end_data, receive, cancel, status, finish
135+ compression zip Enum none, zlib
136+ file_type ft Enum regular, directory, symlink, link
137+ transmission_type tt Enum simple, rsync
138+ id id safe_string A unique-ish value, to avoid collisions
139+ file_id fid safe_string Must be unique per file in a session
140+ bypass pw safe_string hash of the bypass password and the session id
141+ quiet q integer 0 - verbose, 1 - only errors, 2 - totally silent
142+ mtime mod integer the modification time of file in nanoseconds since the UNIX epoch
143+ permissions prm integer the UNIX file permissions bits
144+ size sz integer size in bytes
145+ name n base64_string The path to a file
146+ status st base64_string Status messages
147+ parent pr safe_string The file id of the parent directory
148+ data d base64_bytes Binary data
149+ ================= ======== ============== =======================================================================
150+
151+ Here:
152+
153+ Enum
154+ One from a permitted set of values, for example::
155+
156+ ac=file
157+
158+ safe_string
159+ A string consisting only of characters from the set ``[0-9a-zA-Z_:.,/!@#$%^&*()[]{}~`?"'\\|=+-] ``
160+
161+ integer
162+ A base-10 number composed of the characters ``[0-9] `` with a possible
163+ leading ``- `` sign
164+
165+ base64_string
166+ A base64 encoded UTF-8 string using the standard base64 encoding
167+
168+ base64_bytes
169+ Binary data encoded using the standard base64 encoding
0 commit comments