{"action":"created","comment":{"url":"https://api.github.com/repos/vt6/vt6/pulls/comments/221683831","pull_request_review_id":160392468,"id":221683831,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTY4MzgzMQ==","diff_hunk":"@@ -0,0 +1,204 @@\n+<!-- draft -->\n+# `vt6/term1.0` - Universal terminal capabilities and input/output handling\n+\n+The canonical URL for this document is <https://vt6.io/std/term/1.0/>.\n+\n+**This is a non-normative draft.**\n+\n+The key words \"MUST\", \"MUST NOT\", \"REQUIRED\", \"SHALL\", \"SHALL NOT\", \"SHOULD\", \"SHOULD NOT\", \"RECOMMENDED\",  \"MAY\", and \"OPTIONAL\" in this document are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119).\n+\n+This document uses the predefined property types from [section 2.4 of `vt6/core1.0`](https://vt6.io/std/core/1.0/#section-2-4).\n+\n+## 1. Scope\n+\n+This module defines how a terminal works, how clients' standard output is reflected on the terminal, and how user input is presented on clients' standard input.\n+Besides [`vt6/core`](https://vt6.io/std/core/), this is the only module that we expect to be available in **every** VT6 server implementation across the entire feature spectrum, from graphical terminal emulators all the way down to continuous stationery printers.\n+\n+This document uses the definitions introduced in [section 1 of `vt6/core1.0`](https://vt6.io/std/core/1.0/#section-1).\n+\n+### 1.1. Terminals\n+\n+A **Unicode document** is a string of Unicode characters with a cursor.\n+The cursor points either at the start of the string (before the first character), at its end (after the last character) or between two adjacent characters.\n+\n+When a VT6 server agrees to using this module, it MUST have a Unicode document (the **terminal document**) that its clients can interact with as described in section 1.2.\n+All clients MUST act upon the same terminal document.\n+\n+If the server takes text input from a user or some other source, it MAY pass this input to the clients as described in section 1.3.\n+\n+*Rationale:* This is a \"MAY\" because some servers (e.g. continuous stationery printers) do not have an input method.\n+\n+The terminal document and its cursor SHOULD NOT be manipulated by the server in any way except for those ways specifically permitted in this specification and in the specifications for other VT6 module versions which the server has agreed to using.\n+\n+*Rationale:* Clients should be able to rely on the server interpreting their standard output faithfully.\n+\n+### 1.2. Standard output\n+\n+When the server receives a byte string written by a client into its standard output, the server SHALL assume that this byte string is encoded in [UTF-8](https://tools.ietf.org/html/rfc3629), and decode it into a string of Unicode characters.\n+Invalid byte sequences or invalid code points SHALL be handled gracefully, for instance, by replacing them with the replacement character (U+FFFD).\n+\n+When the `term.output-protected` property is true, the server MUST then discard all characters from this string that are in the general categories Cc (\"Other, control\"), Cf (\"Other, format\"), Cs (\"Other, surrogate\"), Co (\"Other, private use\") and Cn (\"Other, not assigned\"), except for U+0009 (Horizontal Tab), U+000A (New Line), U+000C (Form Feed) and U+000D (Carriage Return).\n+These characters are called **active characters** for the remainder of this specification.\n+When the active character to be discarded is U+001B (Escape), the server MUST also discard characters directly succeeding it as follows:\n+\n+- When the next character after U+001B is from the range U+0040-U+005F, that character is also discarded.\n+- When the character discarded in the previous step was U+005B (the opening bracket `[`), then any succeeding characters that are in the range U+0020-U+003F are also discarded, up until a character from the range U+0040-U+007F is encountered, which is also discarded. If any unexpected characters are found while searching for characters to discard, the server MAY choose to not discard anything except for the initial U+001B character.\n+\n+*Rationale:* That's how ANSI escape sequences are structured.\n+\n+When the `term.output-protected` property is false, the server MAY alternatively:\n+\n+- choose a printable representation for each active character and replace the character with that representation before continuing, or\n+- interpret the control sequence started by that active character if the character is U+001B (Escape).\n+\n+When a control character is interpreted as starting a control sequence, the entire control sequence SHALL be removed from the string before processing as described in this section continues, and the remaining string MAY be modified depending on the semantics of the control sequence.\n+\n+*Rationale:* This rule allows terminals to be backwards-compatible with legacy control sequences, such as those defined in VT100 aka ECMA-48 aka ANSI X3.64 aka ISO/IEC 6429.\n+\n+Characters that are in the general category Co (\"Other, private use\") MAY be exempted from the treatment described above if the characters in question have a graphic representation in the font that the terminal uses to display its character array.\n+\n+Finally, the server MUST discard each U+000A (new line) character that immediately succeeds a U+000D (carriage return) character, and then convert each U+000D character into a U+000A character.\n+\n+*Rationale:* This rule ensures consistent line break handling across different platforms, i.e., CR+NL = CR = NL.\n+\n+The remaining string of Unicode characters SHALL then be inserted into the terminal document at the position pointed to by the cursor.\n+The cursor SHALL be updated to point at the position directly after the inserted string.\n+If the terminal document would grow too large to fit within the program's memory because of this operation, the server MAY choose to discard some of the text at the start of the document.\n+If it does so, it SHOULD discard entire lines or paragraphs, that is, the last codepoint discarded SHOULD be U+000A, U+000C, U+2028 or U+2029.\n+\n+### 1.3. Standard input\n+\n+TODO describe how keypresses are reflected on stdin (canonical/raw mode, noecho property, etc.), how Ctrl-D is handled\n+\n+### 1.4. Display\n+\n+If the server displays the document to a user, or renders it to some graphics device or file, then the terminal document SHALL be laid out according to the rules for normalization, writing direction, line breaking and handling of bidirectional text as defined in the Unicode Standard, as published by the [Unicode consortium](https://www.unicode.org).\n+\n+The surface onto which the terminal document is rendered is called the **terminal viewport**.\n+\n+### 1.5. Scrollback\n+\n+The server MAY impose limits on the size of the terminal document (e.g. because of memory constraints).\n+When new text is added to the terminal document in such a way that the resulting terminal document would exceed those limits, the server MAY discard a prefix of the terminal document.\n+If the cursor points into that prefix or at its start, the cursor SHALL be moved to the end of the prefix before the prefix is discarded.\n+\n+The server SHOULD choose the prefix such that its end is a line separator, paragraph separator, or a line break control character (U+0010).\n+\n+*Rationale:* In other words, servers should prefer to discard whole lines at a time.\n+Chomping off only parts of a line causes unnecessary confusion on the side of the user.\n+\n+## 2. Message types for `vt6/term1`\n+\n+### 2.1. The `term.make-stdio` message","path":"spec/term/1.0.md","position":92,"original_position":92,"commit_id":"12f0b7853719908c3f525d770c6ccee7fcf7a11c","original_commit_id":"12f0b7853719908c3f525d770c6ccee7fcf7a11c","user":{"login":"majewsky","id":24696,"node_id":"MDQ6VXNlcjI0Njk2","avatar_url":"https://avatars0.githubusercontent.com/u/24696?v=4","gravatar_id":"","url":"https://api.github.com/users/majewsky","html_url":"https://github.com/majewsky","followers_url":"https://api.github.com/users/majewsky/followers","following_url":"https://api.github.com/users/majewsky/following{/other_user}","gists_url":"https://api.github.com/users/majewsky/gists{/gist_id}","starred_url":"https://api.github.com/users/majewsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majewsky/subscriptions","organizations_url":"https://api.github.com/users/majewsky/orgs","repos_url":"https://api.github.com/users/majewsky/repos","events_url":"https://api.github.com/users/majewsky/events{/privacy}","received_events_url":"https://api.github.com/users/majewsky/received_events","type":"User","site_admin":false},"body":"See above.","created_at":"2018-10-01T17:01:48Z","updated_at":"2018-10-01T17:01:48Z","html_url":"https://github.com/vt6/vt6/pull/32#discussion_r221683831","pull_request_url":"https://api.github.com/repos/vt6/vt6/pulls/32","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vt6/vt6/pulls/comments/221683831"},"html":{"href":"https://github.com/vt6/vt6/pull/32#discussion_r221683831"},"pull_request":{"href":"https://api.github.com/repos/vt6/vt6/pulls/32"}},"in_reply_to_id":221671249},"pull_request":{"url":"https://api.github.com/repos/vt6/vt6/pulls/32","id":215845648,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1ODQ1NjQ4","html_url":"https://github.com/vt6/vt6/pull/32","diff_url":"https://github.com/vt6/vt6/pull/32.diff","patch_url":"https://github.com/vt6/vt6/pull/32.patch","issue_url":"https://api.github.com/repos/vt6/vt6/issues/32","number":32,"state":"open","locked":false,"title":"WIP: vt6/term and vt6/mono modules","user":{"login":"majewsky","id":24696,"node_id":"MDQ6VXNlcjI0Njk2","avatar_url":"https://avatars0.githubusercontent.com/u/24696?v=4","gravatar_id":"","url":"https://api.github.com/users/majewsky","html_url":"https://github.com/majewsky","followers_url":"https://api.github.com/users/majewsky/followers","following_url":"https://api.github.com/users/majewsky/following{/other_user}","gists_url":"https://api.github.com/users/majewsky/gists{/gist_id}","starred_url":"https://api.github.com/users/majewsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/majewsky/subscriptions","organizations_url":"https://api.github.com/users/majewsky/orgs","repos_url":"https://api.github.com/users/majewsky/repos","events_url":"https://api.github.com/users/majewsky/events{/privacy}","received_events_url":"https://api.github.com/users/majewsky/received_events","type":"User","site_admin":false},"body":"This is based on an earlier draft (#14) where monospace layouting was a capability within vt6/term. I chose to make an entirely new branch because so much has changed in vt6/core1.0 recently that stuff is way cleaner this way.\r\n\r\n@laerling FYI - If you want to read this, start with `term1.0` and then continue with `mono1.0`. The latter depends on the former.","created_at":"2018-09-16T21:14:01Z","updated_at":"2018-10-01T17:01:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fb0df4b49fb362a9fb4d02789ddba450debfe1b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/vt6/vt6/pulls/32/commits","review_comments_url":"https://api.github.com/repos/vt6/vt6/pulls/32/comments","review_comment_url":"https://api.github.com/repos/vt6/vt6/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vt6/vt6/issues/32/comments","statuses_url":"https://api.github.com/repos/vt6/vt6/statuses/12f0b7853719908c3f525d770c6ccee7fcf7a11c","head":{"label":"vt6:term-module-2","ref":"term-module-2","sha":"12f0b7853719908c3f525d770c6ccee7fcf7a11c","user":{"login":"vt6","id":28759762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzU5NzYy","avatar_url":"https://avatars0.githubusercontent.com/u/28759762?v=4","gravatar_id":"","url":"https://api.github.com/users/vt6","html_url":"https://github.com/vt6","followers_url":"https://api.github.com/users/vt6/followers","following_url":"https://api.github.com/users/vt6/following{/other_user}","gists_url":"https://api.github.com/users/vt6/gists{/gist_id}","starred_url":"https://api.github.com/users/vt6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vt6/subscriptions","organizations_url":"https://api.github.com/users/vt6/orgs","repos_url":"https://api.github.com/users/vt6/repos","events_url":"https://api.github.com/users/vt6/events{/privacy}","received_events_url":"https://api.github.com/users/vt6/received_events","type":"Organization","site_admin":false},"repo":{"id":91588841,"node_id":"MDEwOlJlcG9zaXRvcnk5MTU4ODg0MQ==","name":"vt6","full_name":"vt6/vt6","private":false,"owner":{"login":"vt6","id":28759762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzU5NzYy","avatar_url":"https://avatars0.githubusercontent.com/u/28759762?v=4","gravatar_id":"","url":"https://api.github.com/users/vt6","html_url":"https://github.com/vt6","followers_url":"https://api.github.com/users/vt6/followers","following_url":"https://api.github.com/users/vt6/following{/other_user}","gists_url":"https://api.github.com/users/vt6/gists{/gist_id}","starred_url":"https://api.github.com/users/vt6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vt6/subscriptions","organizations_url":"https://api.github.com/users/vt6/orgs","repos_url":"https://api.github.com/users/vt6/repos","events_url":"https://api.github.com/users/vt6/events{/privacy}","received_events_url":"https://api.github.com/users/vt6/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vt6/vt6","description":"A modern protocol for virtual terminals","fork":false,"url":"https://api.github.com/repos/vt6/vt6","forks_url":"https://api.github.com/repos/vt6/vt6/forks","keys_url":"https://api.github.com/repos/vt6/vt6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vt6/vt6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vt6/vt6/teams","hooks_url":"https://api.github.com/repos/vt6/vt6/hooks","issue_events_url":"https://api.github.com/repos/vt6/vt6/issues/events{/number}","events_url":"https://api.github.com/repos/vt6/vt6/events","assignees_url":"https://api.github.com/repos/vt6/vt6/assignees{/user}","branches_url":"https://api.github.com/repos/vt6/vt6/branches{/branch}","tags_url":"https://api.github.com/repos/vt6/vt6/tags","blobs_url":"https://api.github.com/repos/vt6/vt6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vt6/vt6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vt6/vt6/git/refs{/sha}","trees_url":"https://api.github.com/repos/vt6/vt6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vt6/vt6/statuses/{sha}","languages_url":"https://api.github.com/repos/vt6/vt6/languages","stargazers_url":"https://api.github.com/repos/vt6/vt6/stargazers","contributors_url":"https://api.github.com/repos/vt6/vt6/contributors","subscribers_url":"https://api.github.com/repos/vt6/vt6/subscribers","subscription_url":"https://api.github.com/repos/vt6/vt6/subscription","commits_url":"https://api.github.com/repos/vt6/vt6/commits{/sha}","git_commits_url":"https://api.github.com/repos/vt6/vt6/git/commits{/sha}","comments_url":"https://api.github.com/repos/vt6/vt6/comments{/number}","issue_comment_url":"https://api.github.com/repos/vt6/vt6/issues/comments{/number}","contents_url":"https://api.github.com/repos/vt6/vt6/contents/{+path}","compare_url":"https://api.github.com/repos/vt6/vt6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vt6/vt6/merges","archive_url":"https://api.github.com/repos/vt6/vt6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vt6/vt6/downloads","issues_url":"https://api.github.com/repos/vt6/vt6/issues{/number}","pulls_url":"https://api.github.com/repos/vt6/vt6/pulls{/number}","milestones_url":"https://api.github.com/repos/vt6/vt6/milestones{/number}","notifications_url":"https://api.github.com/repos/vt6/vt6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vt6/vt6/labels{/name}","releases_url":"https://api.github.com/repos/vt6/vt6/releases{/id}","deployments_url":"https://api.github.com/repos/vt6/vt6/deployments","created_at":"2017-05-17T14:57:24Z","updated_at":"2018-10-01T16:58:29Z","pushed_at":"2018-10-01T16:58:31Z","git_url":"git://github.com/vt6/vt6.git","ssh_url":"git@github.com:vt6/vt6.git","clone_url":"https://github.com/vt6/vt6.git","svn_url":"https://github.com/vt6/vt6","homepage":"https://vt6.io","size":220,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"base":{"label":"vt6:master","ref":"master","sha":"52a436c35499b151329e619532cd8b492172ccb2","user":{"login":"vt6","id":28759762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzU5NzYy","avatar_url":"https://avatars0.githubusercontent.com/u/28759762?v=4","gravatar_id":"","url":"https://api.github.com/users/vt6","html_url":"https://github.com/vt6","followers_url":"https://api.github.com/users/vt6/followers","following_url":"https://api.github.com/users/vt6/following{/other_user}","gists_url":"https://api.github.com/users/vt6/gists{/gist_id}","starred_url":"https://api.github.com/users/vt6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vt6/subscriptions","organizations_url":"https://api.github.com/users/vt6/orgs","repos_url":"https://api.github.com/users/vt6/repos","events_url":"https://api.github.com/users/vt6/events{/privacy}","received_events_url":"https://api.github.com/users/vt6/received_events","type":"Organization","site_admin":false},"repo":{"id":91588841,"node_id":"MDEwOlJlcG9zaXRvcnk5MTU4ODg0MQ==","name":"vt6","full_name":"vt6/vt6","private":false,"owner":{"login":"vt6","id":28759762,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4NzU5NzYy","avatar_url":"https://avatars0.githubusercontent.com/u/28759762?v=4","gravatar_id":"","url":"https://api.github.com/users/vt6","html_url":"https://github.com/vt6","followers_url":"https://api.github.com/users/vt6/followers","following_url":"https://api.github.com/users/vt6/following{/other_user}","gists_url":"https://api.github.com/users/vt6/gists{/gist_id}","starred_url":"https://api.github.com/users/vt6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vt6/subscriptions","organizations_url":"https://api.github.com/users/vt6/orgs","repos_url":"https://api.github.com/users/vt6/repos","events_url":"https://api.github.com/users/vt6/events{/privacy}","received_events_url":"https://api.github.com/users/vt6/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/vt6/vt6","description":"A modern protocol for virtual terminals","fork":false,"url":"https://api.github.com/repos/vt6/vt6","forks_url":"https://api.github.com/repos/vt6/vt6/forks","keys_url":"https://api.github.com/repos/vt6/vt6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vt6/vt6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vt6/vt6/teams","hooks_url":"https://api.github.com/repos/vt6/vt6/hooks","issue_events_url":"https://api.github.com/repos/vt6/vt6/issues/events{/number}","events_url":"https://api.github.com/repos/vt6/vt6/events","assignees_url":"https://api.github.com/repos/vt6/vt6/assignees{/user}","branches_url":"https://api.github.com/repos/vt6/vt6/branches{/branch}","tags_url":"https://api.github.com/repos/vt6/vt6/tags","blobs_url":"https://api.github.com/repos/vt6/vt6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vt6/vt6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vt6/vt6/git/refs{/sha}","trees_url":"https://api.github.com/repos/vt6/vt6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vt6/vt6/statuses/{sha}","languages_url":"https://api.github.com/repos/vt6/vt6/languages","stargazers_url":"https://api.github.com/repos/vt6/vt6/stargazers","contributors_url":"https://api.github.com/repos/vt6/vt6/contributors","subscribers_url":"https://api.github.com/repos/vt6/vt6/subscribers","subscription_url":"https://api.github.com/repos/vt6/vt6/subscription","commits_url":"https://api.github.com/repos/vt6/vt6/commits{/sha}","git_commits_url":"https://api.github.com/repos/vt6/vt6/git/commits{/sha}","comments_url":"https://api.github.com/repos/vt6/vt6/comments{/number}","issue_comment_url":"https://api.github.com/repos/vt6/vt6/issues/comments{/number}","contents_url":"https://api.github.com/repos/vt6/vt6/contents/{+path}","compare_url":"https://api.github.com/repos/vt6/vt6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vt6/vt6/merges","archive_url":"https://api.github.com/repos/vt6/vt6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vt6/vt6/downloads","issues_url":"https://api.github.com/repos/vt6/vt6/issues{/number}","pulls_url":"https://api.github.com/repos/vt6/vt6/pulls{/number}","milestones_url":"https://api.github.com/repos/vt6/vt6/milestones{/number}","notifications_url":"https://api.github.com/repos/vt6/vt6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vt6/vt6/labels{/name}","releases_url":"https://api.github.com/repos/vt6/vt6/releases{/id}","deployments_url":"https://api.github.com/repos/vt6/vt6/deployments","created_at":"2017-05-17T14:57:24Z","updated_at":"2018-10-01T16:58:29Z","pushed_at":"2018-10-01T16:58:31Z","git_url":"git://github.com/vt6/vt6.git","ssh_url":"git@github.com:vt6/vt6.git","clone_url":"https://github.com/vt6/vt6.git","svn_url":"https://github.com/vt6/vt6","homepage":"https://vt6.io","size":220,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":0,"open_issues":5,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vt6/vt6/pulls/32"},"html":{"href":"https://github.com/vt6/vt6/pull/32"},"issue":{"href":"https://api.github.com/repos/vt6/vt6/issues/32"},"comments":{"href":"https://api.github.com/repos/vt6/vt6/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/vt6/vt6/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/vt6/vt6/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vt6/vt6/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/vt6/vt6/statuses/12f0b7853719908c3f525d770c6ccee7fcf7a11c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"majewsky"}}