-
Notifications
You must be signed in to change notification settings - Fork 319
docs/vt: document a bunch of OSCs #399
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
Conversation
|
@pluiedev is attempting to deploy a commit to the Ghostty Team on Vercel. A member of the Team first needs to authorize it. |
749f151 to
8fb52d4
Compare
8fb52d4 to
4a6a129
Compare
00-kat
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.
N.B.: I did sometimes try to maintain hard-wrap in suggestions but not always, so they may need re-wrapping.
| An OSC sequence begins with OSC (`ESC ]` or `0x9d`). Then, by convention, an | ||
| integer is added to identify the operation | ||
|
|
||
| OSC Sequences are typically used to encode strings or other non-integer data to | ||
| transmit between the terminal and the application. The format of an OSC sequence | ||
| is below. An example OSC sequence is `OSC 2 ; 👻 Ghostty 👻 ST` (where `ST` is | ||
| the String Terminator). By convention, OSC sequences *usually* have some integer | ||
| identifier to identify the sequence. | ||
| The format of an OSC sequence is below. By convention, OSC sequences are | ||
| identified by an integer identifier followed by a semicolon (`;`), although | ||
| this is never required by the standard. Certain obsolete OSC sequences use | ||
| non-numeric identifiers before the semicolon, but Ghostty does not support |
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 convention of adding an integer is mentioned twice on adjacent sentences.
| An OSC sequence begins with OSC (`ESC ]` or `0x9d`). Then, by convention, an | |
| integer is added to identify the operation | |
| OSC Sequences are typically used to encode strings or other non-integer data to | |
| transmit between the terminal and the application. The format of an OSC sequence | |
| is below. An example OSC sequence is `OSC 2 ; 👻 Ghostty 👻 ST` (where `ST` is | |
| the String Terminator). By convention, OSC sequences *usually* have some integer | |
| identifier to identify the sequence. | |
| The format of an OSC sequence is below. By convention, OSC sequences are | |
| identified by an integer identifier followed by a semicolon (`;`), although | |
| this is never required by the standard. Certain obsolete OSC sequences use | |
| non-numeric identifiers before the semicolon, but Ghostty does not support | |
| The format of an OSC sequence is below. An OSC sequence begins with OSC (`ESC ]` | |
| or `0x9d`). Then, by convention, an integer is added to identify the operation, | |
| followed by a semicolon (`;`), although this is never required by the standard. | |
| Certain obsolete OSC sequences use non-numeric identifiers before the semicolon, | |
| but Ghostty does not support |
| this is never required by the standard. Certain obsolete OSC sequences use | ||
| non-numeric identifiers before the semicolon, but Ghostty does not support | ||
|
|
||
| > [!NOTE] |
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.
Having a note that interrupts a line reads really weirdly to me; I don't know how it renders on the website but the file's contents and GitHub's rendered view both look odd.
I think the note should be moved under the format description (i.e. right above the DCS heading), since otherwise the format is quite far away from “The format of an OSC sequence is below” in the first line of the paragraph before the note.
| identifier to identify the sequence. | ||
| The format of an OSC sequence is below. By convention, OSC sequences are | ||
| identified by an integer identifier followed by a semicolon (`;`), although | ||
| this is never required by the standard. Certain obsolete OSC sequences use |
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 has not been a mention of the standard before this, and no other mention clarifies which standard is being referred to: many OSCs have their own standard that require the integer identifier, so this might cause confusion.
Also I feel like “specified” is a better term than “required” here since OSCs can't be parsed without some way to know what's being parsed (as it's just arbitrary data), so there's always some means of identifying it and including the identifier is required even if the standard doesn't say what the identifier looks like or where it goes.
| osc_sequence = "0x1B" "]" data terminator | ||
| data = [0x20-0xFF] | ||
| ST = "0x1B" "0x5C" | ||
| terminator = "0x1B" "0x5C" |
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.
Shouldn't BEL be included here?
| terminator = "0x1B" "0x5C" | |
| terminator = "0x1B" "0x5C" | "0x07" |
| Below is a list of protocols that Ghostty supports, which originate from other | ||
| terminal emulators: |
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.
Is this list actually exhaustive? I could assume it's close for just OSCs but the page is in /docs/vt and not /docs/vt/osc, and it's missing at the very least KIP (I haven't tried to determine what else is missing, this is just the first one I thought of since the page on sequences mentions it). It might be worth noting this “isn't exhaustive” or is “still work in progress”?
| When `d` is the single character `?`, the terminal will reply with | ||
| another OSC 52 sequence with the data found from the first clipboard | ||
| listed in `t` that contains the requested data. |
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.
I think this could use an example: while it's obvious what the response looks like, it's not particularly obvious what the t value is in the presence of multiple clipboards in t.
Edit: Ghostty seems to just do nothing…?
| @@ -0,0 +1,72 @@ | |||
| --- | |||
| title: Colors | |||
| description: All sorts of information regarding colors in terminal emulation. | |||
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.
| description: All sorts of information regarding colors in terminal emulation. | |
| description: Assorted information about colors in terminals. |
“All sorts of” → “Assorted” was just one of… assorted changes, but “terminal emulation” to me feels like an obscure way to put it, and “terminals” over “terminal emulators” since that seems to be more common in these docs.
| <VTSequence sequence={["#", "Pr", "Pg", "Pb"]} /> | ||
|
|
||
| Where each of `r`, `g` and `b` can be one to four hexadecimal digits, | ||
| corresponding to 4, 8, 12 or 16 bit color channels respectively. |
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.
Other docs use a serial comma.
| corresponding to 4, 8, 12 or 16 bit color channels respectively. | |
| corresponding to 4, 8, 12, or 16 bit color channels respectively. |
| <VTSequence sequence={["#", "Pr", "Pg", "Pb"]} /> | ||
|
|
||
| Where each of `r`, `g` and `b` can be one to four hexadecimal digits, | ||
| corresponding to 4, 8, 12 or 16 bit color channels respectively. |
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.
| corresponding to 4, 8, 12 or 16 bit color channels respectively. | |
| corresponding to 4, 8, 12 and 16 bit color channels respectively. |
I think.
| description: All sorts of information regarding colors in terminal emulation. | ||
| --- | ||
|
|
||
| Ghostty emulates a full 256-color palette, as well as 5 **special colors** |
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.
Might it also be useful to note what the 256-color palette is?
|
I think there are a bunch of improvements that can be made but I'm going to accept this as a general net positive. Thank you. |
What it says on the tin. The precise list is OSCs 0-2, 4, 5, 7, 9, 9;4, 10-19, 22, 52, 104, 105 and 110-119.
Also expanded the concept page about control sequences and added a concept page detailing the color syntax we support.