turbo-editors/turbo-jspublic Fork
⑂ 2f16a4d
Commits
⬇ Clone ▾
git clone https://git.rickub.com/turbo-editors/turbo-js.git
git clone ssh://git@rickub.com/turbo-editors/turbo-js.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

📦 Turbo JS

k33g committed 2026-09-22T06:56:24+02:00 Browse files
2f16a4d parent: 5db4bb2
added .memory/handoffs/2026-09-21-asciidoc-docs.md +5 -0
new file mode 100644
@@ -0,0 +1,5 @@
1+# Handoff — 2026-09-21 — AsciiDoc in turbo-core v1.0.4: this editor's side
2+
3+- Template comment and docs (EN+FR) already say nine languages and describe AsciiDoc; nothing else here changes.
4+- **Next**: when turbo-core v1.0.4 is tagged, `go get rickub.com/turbo-editors/turbo-core@v1.0.4 && go mod tidy && GOWORK=off make check`. Then open a `.adoc` file in the real editor once and check it colours.
5+- **Trap**: `templates_test.go` iterates `syntax.Registered()`; any further built-in language in turbo-core needs one more word in the template comment here, before the pin.
new file mode 100644
@@ -0,0 +1,5 @@
1+# Handoff — 2026-09-21 — AsciiDoc in turbo-core v1.0.4: this editor's side
2+
3+- Template comment and docs (EN+FR) already say nine languages and describe AsciiDoc; nothing else here changes.
4+- **Next**: when turbo-core v1.0.4 is tagged, `go get rickub.com/turbo-editors/turbo-core@v1.0.4 && go mod tidy && GOWORK=off make check`. Then open a `.adoc` file in the real editor once and check it colours.
5+- **Trap**: `templates_test.go` iterates `syntax.Registered()`; any further built-in language in turbo-core needs one more word in the template comment here, before the pin.
added .memory/handoffs/2026-09-21-terminal-clipboard-docs.md +5 -0
new file mode 100644
@@ -0,0 +1,5 @@
1+# Handoff — 2026-09-21 — terminal copy/paste in turbo-core v1.0.4: this editor's side
2+
3+- Docs (EN+FR) already describe `Ctrl-Ins` / `Shift-Ins` / `Shift-↑↓` / mouse drag in a terminal window and bracketed paste (mode 2004); no code here changes.
4+- **Next**: when turbo-core v1.0.4 is tagged, `go get rickub.com/turbo-editors/turbo-core@v1.0.4 && go mod tidy && GOWORK=off make check`. Then try one round trip by hand: drag over shell output, `Ctrl-Ins`, `Shift-Ins` into a file, and back.
5+- **Trap**: until the re-pin, a binary built with `GOWORK=off` shows docs for a feature it does not have — build under the umbrella `go.work` to see it.
new file mode 100644
@@ -0,0 +1,5 @@
1+# Handoff — 2026-09-21 — terminal copy/paste in turbo-core v1.0.4: this editor's side
2+
3+- Docs (EN+FR) already describe `Ctrl-Ins` / `Shift-Ins` / `Shift-↑↓` / mouse drag in a terminal window and bracketed paste (mode 2004); no code here changes.
4+- **Next**: when turbo-core v1.0.4 is tagged, `go get rickub.com/turbo-editors/turbo-core@v1.0.4 && go mod tidy && GOWORK=off make check`. Then try one round trip by hand: drag over shell output, `Ctrl-Ins`, `Shift-Ins` into a file, and back.
5+- **Trap**: until the re-pin, a binary built with `GOWORK=off` shows docs for a feature it does not have — build under the umbrella `go.work` to see it.
modified .memory/history.md +10 -0
@@ -49,3 +49,13 @@ Append-only. One dated entry per session. Never rewritten.
4949 - **Later, same session**: `release.env` is now **committed** — `.gitignore` gained `!release.env` under `*.env`, with a comment; `*.token.env` files stay ignored (verified with `git check-ignore` in every repository). The comments that said it was ignored were reworded to match: `02-build-releases.sh`, `.github/workflows/release.yml`, the release how-to (EN+FR), and this summary. Asked by the user so the version and its description travel with the repository.
5050 - **End of session**: turbo-core v1.0.3 having been published and `go.mod` re-pinned to it from the host, `GOWORK=off go test ./... -count=1` is entirely green here, the two release-script tests included.
5151
52+## 2026-09-21 — AsciiDoc arrives in turbo-core (ticket #31): template comment and docs ahead of the re-pin
53+
54+- **Changed here**: the `languages` comment of `snippets.toml.tmpl` names `asciidoc`; `docs/{en,fr}/reference/languages.md` gained an `AsciiDoc` recognition row, `AsciiDoc` in the class rows it uses, and an `## AsciiDoc` section after Markdown's; every sentence counting turbo-core's eight languages says nine and lists AsciiDoc. Done from the umbrella session that added the scanner to turbo-core (for v1.0.4).
55+- **Why now**: `templates_test.go` checks the created snippets file names every `syntax.Registered()` language, so the comment would have gone red the moment `go.mod` moved to v1.0.4. Against the pinned v1.0.3 the test still passes (presence, not exactness).
56+- **Not done**: `go.mod` still pins v1.0.3; nothing committed.
57+
58+## 2026-09-21 — terminal copy/paste arrives in turbo-core v1.0.4: docs ahead of the re-pin
59+
60+- **Changed here** (docs only, EN+FR): `how-to/use-a-terminal.md` gained "Copy from the terminal into a file, and back"; `reference/terminal.md` gained the selection keys, the drag row, a "Copying and pasting" table, private mode 2004, `editor.selection` in the colours, and lost "bracketed paste" from the not-implemented list; `reference/keyboard.md` gained the terminal and mouse rows; `explanation/terminal-windows.md` gained "Copying out and pasting in". Applied from the umbrella session that added the feature to turbo-core, by one anchored script across the six editors.
61+- **Not done**: `go.mod` still pins v1.0.3, so the binary built without the workspace does not yet have the feature the docs describe; nothing committed.
@@ -49,3 +49,13 @@ Append-only. One dated entry per session. Never rewritten.
49 - **Later, same session**: `release.env` is now **committed** — `.gitignore` gained `!release.env` under `*.env`, with a comment; `*.token.env` files stay ignored (verified with `git check-ignore` in every repository). The comments that said it was ignored were reworded to match: `02-build-releases.sh`, `.github/workflows/release.yml`, the release how-to (EN+FR), and this summary. Asked by the user so the version and its description travel with the repository.49 - **Later, same session**: `release.env` is now **committed** — `.gitignore` gained `!release.env` under `*.env`, with a comment; `*.token.env` files stay ignored (verified with `git check-ignore` in every repository). The comments that said it was ignored were reworded to match: `02-build-releases.sh`, `.github/workflows/release.yml`, the release how-to (EN+FR), and this summary. Asked by the user so the version and its description travel with the repository.
50 - **End of session**: turbo-core v1.0.3 having been published and `go.mod` re-pinned to it from the host, `GOWORK=off go test ./... -count=1` is entirely green here, the two release-script tests included.50 - **End of session**: turbo-core v1.0.3 having been published and `go.mod` re-pinned to it from the host, `GOWORK=off go test ./... -count=1` is entirely green here, the two release-script tests included.
51 51
52+## 2026-09-21 — AsciiDoc arrives in turbo-core (ticket #31): template comment and docs ahead of the re-pin
53+
54+- **Changed here**: the `languages` comment of `snippets.toml.tmpl` names `asciidoc`; `docs/{en,fr}/reference/languages.md` gained an `AsciiDoc` recognition row, `AsciiDoc` in the class rows it uses, and an `## AsciiDoc` section after Markdown's; every sentence counting turbo-core's eight languages says nine and lists AsciiDoc. Done from the umbrella session that added the scanner to turbo-core (for v1.0.4).
55+- **Why now**: `templates_test.go` checks the created snippets file names every `syntax.Registered()` language, so the comment would have gone red the moment `go.mod` moved to v1.0.4. Against the pinned v1.0.3 the test still passes (presence, not exactness).
56+- **Not done**: `go.mod` still pins v1.0.3; nothing committed.
57+
58+## 2026-09-21 — terminal copy/paste arrives in turbo-core v1.0.4: docs ahead of the re-pin
59+
60+- **Changed here** (docs only, EN+FR): `how-to/use-a-terminal.md` gained "Copy from the terminal into a file, and back"; `reference/terminal.md` gained the selection keys, the drag row, a "Copying and pasting" table, private mode 2004, `editor.selection` in the colours, and lost "bracketed paste" from the not-implemented list; `reference/keyboard.md` gained the terminal and mouse rows; `explanation/terminal-windows.md` gained "Copying out and pasting in". Applied from the umbrella session that added the feature to turbo-core, by one anchored script across the six editors.
61+- **Not done**: `go.mod` still pins v1.0.3, so the binary built without the workspace does not yet have the feature the docs describe; nothing committed.
modified .memory/summary.md +4 -0
@@ -105,3 +105,7 @@ To build against a turbo-core you have changed but not released: `go work init .
105105
106106 - **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. `go.mod` pins **turbo-core v1.0.3**, which is published (re-pinned from the host on 2026-09-20), so it builds on its own again. A project with a `.turbo-js` already is refused, not overwritten.
107107
108+## State as of 2026-09-21
109+
110+- Docs and the snippets template already describe **turbo-core v1.0.4's AsciiDoc** (ninth built-in language) while `go.mod` still pins v1.0.3; the suite passes either way. Re-pin when v1.0.4 is tagged.
111+
@@ -105,3 +105,7 @@ To build against a turbo-core you have changed but not released: `go work init .
105 105
106 - **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. `go.mod` pins **turbo-core v1.0.3**, which is published (re-pinned from the host on 2026-09-20), so it builds on its own again. A project with a `.turbo-js` already is refused, not overwritten.106 - **`-load-config <url>` is wired** (`main.go`: `loadConfig`, `describeLoad`), on top of turbo-core's `configrepo`. `go.mod` pins **turbo-core v1.0.3**, which is published (re-pinned from the host on 2026-09-20), so it builds on its own again. A project with a `.turbo-js` already is refused, not overwritten.
107 107
108+## State as of 2026-09-21
109+
110+- Docs and the snippets template already describe **turbo-core v1.0.4's AsciiDoc** (ninth built-in language) while `go.mod` still pins v1.0.3; the suite passes either way. Re-pin when v1.0.4 is tagged.
111+
modified docs/en/explanation/architecture.md +2 -2
@@ -57,7 +57,7 @@ Everything that would otherwise be a hardcoded `"turbo-js"`, `"node"` or `".js"`
5757
5858 ## Why the JavaScript scanner is here when the library has one
5959
60-turbo-core colours eight languages itself: TOML, YAML, Markdown, JavaScript, HTML, XML, Dockerfiles and shell. Those are the ones every editor meets whatever it is for — a project's configuration is TOML or YAML, its documentation is Markdown, its scripts are shell, its image build a Dockerfile, and a web page or a README's code fence is JavaScript.
60+turbo-core colours nine languages itself: TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, Dockerfiles and shell. Those are the ones every editor meets whatever it is for — a project's configuration is TOML or YAML, its documentation is Markdown, its scripts are shell, its image build a Dockerfile, and a web page or a README's code fence is JavaScript.
6161
6262 So JavaScript is the one language in this family that the library colours *and* an editor is for. The library's scanner is written for the Rust editor's README: it knows the keywords, the strings, the comments and the numbers, and it deliberately refuses regular expressions, because telling `/x/g` from a division needs the previous token and a wrong guess there colours the rest of a line as a string — a bad trade for a language you only meet in passing. An editor *for* JavaScript makes the opposite trade: regular expressions are on every other line of a Node program, and the guess can be bounded. It also owes its user Node's globals, the hashbang line, the name after `function`, private names and decorators.
6363
@@ -65,7 +65,7 @@ The library allows exactly this. `syntax.Register` replaces a language registere
6565
6666 ## Why JSON is here too
6767
68-JSON is not one of the library's eight, and a Node project cannot be edited without it: `package.json` is the manifest and the root marker, `package-lock.json` is beside it, `tsconfig.json` and `.eslintrc.json` are common neighbours. So the editor that is for Node registers a JSON scanner, thirty lines long, that tells a key from a value and tolerates the comments `tsconfig.json` has.
68+JSON is not one of the library's nine, and a Node project cannot be edited without it: `package.json` is the manifest and the root marker, `package-lock.json` is beside it, `tsconfig.json` and `.eslintrc.json` are common neighbours. So the editor that is for Node registers a JSON scanner, thirty lines long, that tells a key from a value and tolerates the comments `tsconfig.json` has.
6969
7070 That could have gone into the library instead — a Go editor meets a `package.json` too, in a repository with a front end. It was not, for the reason that keeps the Go and Rust scanners out: the library grows a language every time somebody wants one, and "what does this editor register?" stops being the first question about a new one. If turbo-core learns JSON one day, this registration will still win by ordering, and the one here can then be removed.
7171
@@ -57,7 +57,7 @@ Everything that would otherwise be a hardcoded `"turbo-js"`, `"node"` or `".js"`
57 57
58 ## Why the JavaScript scanner is here when the library has one58 ## Why the JavaScript scanner is here when the library has one
59 59
60-turbo-core colours eight languages itself: TOML, YAML, Markdown, JavaScript, HTML, XML, Dockerfiles and shell. Those are the ones every editor meets whatever it is for — a project's configuration is TOML or YAML, its documentation is Markdown, its scripts are shell, its image build a Dockerfile, and a web page or a README's code fence is JavaScript.60+turbo-core colours nine languages itself: TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, Dockerfiles and shell. Those are the ones every editor meets whatever it is for — a project's configuration is TOML or YAML, its documentation is Markdown, its scripts are shell, its image build a Dockerfile, and a web page or a README's code fence is JavaScript.
61 61
62 So JavaScript is the one language in this family that the library colours *and* an editor is for. The library's scanner is written for the Rust editor's README: it knows the keywords, the strings, the comments and the numbers, and it deliberately refuses regular expressions, because telling `/x/g` from a division needs the previous token and a wrong guess there colours the rest of a line as a string — a bad trade for a language you only meet in passing. An editor *for* JavaScript makes the opposite trade: regular expressions are on every other line of a Node program, and the guess can be bounded. It also owes its user Node's globals, the hashbang line, the name after `function`, private names and decorators.62 So JavaScript is the one language in this family that the library colours *and* an editor is for. The library's scanner is written for the Rust editor's README: it knows the keywords, the strings, the comments and the numbers, and it deliberately refuses regular expressions, because telling `/x/g` from a division needs the previous token and a wrong guess there colours the rest of a line as a string — a bad trade for a language you only meet in passing. An editor *for* JavaScript makes the opposite trade: regular expressions are on every other line of a Node program, and the guess can be bounded. It also owes its user Node's globals, the hashbang line, the name after `function`, private names and decorators.
63 63
@@ -65,7 +65,7 @@ The library allows exactly this. `syntax.Register` replaces a language registere
65 65
66 ## Why JSON is here too66 ## Why JSON is here too
67 67
68-JSON is not one of the library's eight, and a Node project cannot be edited without it: `package.json` is the manifest and the root marker, `package-lock.json` is beside it, `tsconfig.json` and `.eslintrc.json` are common neighbours. So the editor that is for Node registers a JSON scanner, thirty lines long, that tells a key from a value and tolerates the comments `tsconfig.json` has.68+JSON is not one of the library's nine, and a Node project cannot be edited without it: `package.json` is the manifest and the root marker, `package-lock.json` is beside it, `tsconfig.json` and `.eslintrc.json` are common neighbours. So the editor that is for Node registers a JSON scanner, thirty lines long, that tells a key from a value and tolerates the comments `tsconfig.json` has.
69 69
70 That could have gone into the library instead — a Go editor meets a `package.json` too, in a repository with a front end. It was not, for the reason that keeps the Go and Rust scanners out: the library grows a language every time somebody wants one, and "what does this editor register?" stops being the first question about a new one. If turbo-core learns JSON one day, this registration will still win by ordering, and the one here can then be removed.70 That could have gone into the library instead — a Go editor meets a `package.json` too, in a repository with a front end. It was not, for the reason that keeps the Go and Rust scanners out: the library grows a language every time somebody wants one, and "what does this editor register?" stops being the first question about a new one. If turbo-core learns JSON one day, this registration will still win by ordering, and the one here can then be removed.
71 71
modified docs/en/explanation/colouring-and-completion.md +1 -1
@@ -69,7 +69,7 @@ It is registered under its own name, `json`, so a ```json fence in an agent wind
6969
7070 ## The other seven languages come free
7171
72-TOML, YAML, Markdown, HTML, XML, Dockerfiles and shell are coloured by turbo-core, not here. A Node project has a `README.md`, a `compose.yaml` for the database it talks to, a `Dockerfile` to ship as, a `.github/workflows/ci.yml`, and an editor that coloured only the `.js` files would make you leave it for the rest.
72+TOML, YAML, Markdown, AsciiDoc, HTML, XML, Dockerfiles and shell are coloured by turbo-core, not here. A Node project has a `README.md`, a `compose.yaml` for the database it talks to, a `Dockerfile` to ship as, a `.github/workflows/ci.yml`, and an editor that coloured only the `.js` files would make you leave it for the rest.
7373
7474 That they are shared rather than copied is the point of the library: they were written once, for Turbo Go, and Turbo JS got them by importing a package. JavaScript is the eighth, and this editor took it over rather than inheriting it.
7575
@@ -69,7 +69,7 @@ It is registered under its own name, `json`, so a ```json fence in an agent wind
69 69
70 ## The other seven languages come free70 ## The other seven languages come free
71 71
72-TOML, YAML, Markdown, HTML, XML, Dockerfiles and shell are coloured by turbo-core, not here. A Node project has a `README.md`, a `compose.yaml` for the database it talks to, a `Dockerfile` to ship as, a `.github/workflows/ci.yml`, and an editor that coloured only the `.js` files would make you leave it for the rest.72+TOML, YAML, Markdown, AsciiDoc, HTML, XML, Dockerfiles and shell are coloured by turbo-core, not here. A Node project has a `README.md`, a `compose.yaml` for the database it talks to, a `Dockerfile` to ship as, a `.github/workflows/ci.yml`, and an editor that coloured only the `.js` files would make you leave it for the rest.
73 73
74 That they are shared rather than copied is the point of the library: they were written once, for Turbo Go, and Turbo JS got them by importing a package. JavaScript is the eighth, and this editor took it over rather than inheriting it.74 That they are shared rather than copied is the point of the library: they were written once, for Turbo Go, and Turbo JS got them by importing a package. JavaScript is the eighth, and this editor took it over rather than inheriting it.
75 75
modified docs/en/explanation/terminal-windows.md +8 -0
@@ -38,6 +38,14 @@ Those exceptions are not a compromise between the two claims — they are the wa
3838
3939 What this costs is real and worth naming: `Alt-B` and `Alt-F` reach the shell, so readline's word movement works, but a program inside a terminal window can never see `F1`…`F12`. `htop`'s function-key menu is unreachable. That is the trade, and it was made in favour of always being able to get out.
4040
41+## Copying out and pasting in
42+
43+A terminal's output is wanted elsewhere as often as it is read: a path out of a build error, a line of a stack trace, a command's result to paste into the file beside it. And the other way round, a command written in a file and wanted at the prompt. The two obvious keys are unavailable, and the previous section says why: `Ctrl-C` interrupts and `Ctrl-V` is readline's quoted-insert, and a terminal that took either would be a worse terminal. So the terminal has the editor's *other* spelling of the same two commands, `Ctrl-Ins` and `Shift-Ins`, which the Edit menu already shows and which no shell has a use for — sent through, either would arrive as a plain `Insert` and toggle overwrite mode.
44+
45+The selection is stored as two cells of the whole text, history and live screen together, rather than as screen positions. That is what lets a selection survive the shell writing below it: a line that scrolls off the top into the history keeps its index, because the history grows by exactly the row the screen lost. Keyboard selection is by whole lines, as in the agent window and for the same reason — nothing here is edited, and a whole line is nearly always what was meant; the mouse selects by character because a path in the middle of a line is the other thing people want. Copying goes to both clipboards, the editor's and the system's, again as in the agent window and for the same reason: "copy this" from a terminal usually means to take it out of the editor entirely.
46+
47+Pasting is the one place the emulator's boundary moved. A paste is typed into the shell with `Enter` for each line ending, which is what a terminal does; but `bash`, `zsh` and `fish` all ask for *bracketed paste* — private mode 2004 — precisely so that a multi-line paste arrives as one block to edit rather than as lines to run. The emulator used to ignore that mode with the others. It now remembers it, and only that: it still never pastes on its own, but when the editor pastes on the user's behalf it can wrap the text in the marks the shell asked for. A paste from outside the editor into a terminal window is handed over the same way, whole, rather than replayed as keystrokes — the same rule the agent window's box follows.
48+
4149 ## Why closing a terminal asks nothing
4250
4351 Closing a modified file asks whether to save it. Closing a terminal does not ask anything at all, and that asymmetry is deliberate.
@@ -38,6 +38,14 @@ Those exceptions are not a compromise between the two claims — they are the wa
38 38
39 What this costs is real and worth naming: `Alt-B` and `Alt-F` reach the shell, so readline's word movement works, but a program inside a terminal window can never see `F1`…`F12`. `htop`'s function-key menu is unreachable. That is the trade, and it was made in favour of always being able to get out.39 What this costs is real and worth naming: `Alt-B` and `Alt-F` reach the shell, so readline's word movement works, but a program inside a terminal window can never see `F1`…`F12`. `htop`'s function-key menu is unreachable. That is the trade, and it was made in favour of always being able to get out.
40 40
41+## Copying out and pasting in
42+
43+A terminal's output is wanted elsewhere as often as it is read: a path out of a build error, a line of a stack trace, a command's result to paste into the file beside it. And the other way round, a command written in a file and wanted at the prompt. The two obvious keys are unavailable, and the previous section says why: `Ctrl-C` interrupts and `Ctrl-V` is readline's quoted-insert, and a terminal that took either would be a worse terminal. So the terminal has the editor's *other* spelling of the same two commands, `Ctrl-Ins` and `Shift-Ins`, which the Edit menu already shows and which no shell has a use for — sent through, either would arrive as a plain `Insert` and toggle overwrite mode.
44+
45+The selection is stored as two cells of the whole text, history and live screen together, rather than as screen positions. That is what lets a selection survive the shell writing below it: a line that scrolls off the top into the history keeps its index, because the history grows by exactly the row the screen lost. Keyboard selection is by whole lines, as in the agent window and for the same reason — nothing here is edited, and a whole line is nearly always what was meant; the mouse selects by character because a path in the middle of a line is the other thing people want. Copying goes to both clipboards, the editor's and the system's, again as in the agent window and for the same reason: "copy this" from a terminal usually means to take it out of the editor entirely.
46+
47+Pasting is the one place the emulator's boundary moved. A paste is typed into the shell with `Enter` for each line ending, which is what a terminal does; but `bash`, `zsh` and `fish` all ask for *bracketed paste* — private mode 2004 — precisely so that a multi-line paste arrives as one block to edit rather than as lines to run. The emulator used to ignore that mode with the others. It now remembers it, and only that: it still never pastes on its own, but when the editor pastes on the user's behalf it can wrap the text in the marks the shell asked for. A paste from outside the editor into a terminal window is handed over the same way, whole, rather than replayed as keystrokes — the same rule the agent window's box follows.
48+
41 ## Why closing a terminal asks nothing49 ## Why closing a terminal asks nothing
42 50
43 Closing a modified file asks whether to save it. Closing a terminal does not ask anything at all, and that asymmetry is deliberate.51 Closing a modified file asks whether to save it. Closing a terminal does not ask anything at all, and that asymmetry is deliberate.
modified docs/en/how-to/navigate-code.md +1 -1
@@ -60,7 +60,7 @@ If the windows are on top of each other, `Window ▸ Tile` lays them out side by
6060
6161 ## Variants
6262
63-**The file is not JavaScript.** Everything above works except F12, which needs a language server, and the only one this editor starts is `typescript-language-server`, for JavaScript. Colouring is unaffected: the eight other languages the editor knows — JSON, TOML, YAML, Markdown, HTML, XML, Dockerfiles and shell — are coloured as usual; see [Languages coloured](../reference/languages.md).
63+**The file is not JavaScript.** Everything above works except F12, which needs a language server, and the only one this editor starts is `typescript-language-server`, for JavaScript. Colouring is unaffected: the nine other languages the editor knows — JSON, TOML, YAML, Markdown, AsciiDoc, HTML, XML, Dockerfiles and shell — are coloured as usual; see [Languages coloured](../reference/languages.md).
6464
6565 **You want to see where you are.** The right-hand end of the status bar always shows `line:column`, counting from one.
6666
@@ -60,7 +60,7 @@ If the windows are on top of each other, `Window ▸ Tile` lays them out side by
60 60
61 ## Variants61 ## Variants
62 62
63-**The file is not JavaScript.** Everything above works except F12, which needs a language server, and the only one this editor starts is `typescript-language-server`, for JavaScript. Colouring is unaffected: the eight other languages the editor knows — JSON, TOML, YAML, Markdown, HTML, XML, Dockerfiles and shell — are coloured as usual; see [Languages coloured](../reference/languages.md).63+**The file is not JavaScript.** Everything above works except F12, which needs a language server, and the only one this editor starts is `typescript-language-server`, for JavaScript. Colouring is unaffected: the nine other languages the editor knows — JSON, TOML, YAML, Markdown, AsciiDoc, HTML, XML, Dockerfiles and shell — are coloured as usual; see [Languages coloured](../reference/languages.md).
64 64
65 **You want to see where you are.** The right-hand end of the status bar always shows `line:column`, counting from one.65 **You want to see where you are.** The right-hand end of the status bar always shows `line:column`, counting from one.
66 66
modified docs/en/how-to/use-a-terminal.md +15 -0
@@ -37,6 +37,21 @@ What the editor keeps is short, and deliberate — it is the way back out:
3737
3838 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.
3939
40+## Copy from the terminal into a file, and back
41+
42+The shell keeps `Ctrl-C` and `Ctrl-V`, so the terminal uses the editor's other spelling of copy and paste — the one the Edit menu shows.
43+
44+**Out of the terminal.** Select what you want, then press `Ctrl-Ins` (or choose **Edit ▸ Copy**):
45+
46+- **With the mouse**, drag over the text. A drag that runs past the window's edge keeps selecting up to it.
47+- **With the keyboard**, `Shift-↑` and `Shift-↓` select whole lines, starting from the line the shell's cursor is on and growing a line at a time.
48+
49+The selection is highlighted, and the status bar says how many lines were copied. The text goes on the editor's clipboard and, if your terminal allows it, on the system's too. Switch to a file and press `Shift-Ins` to paste it. A window whose command has finished can still be selected and copied from.
50+
51+**Into the terminal.** Copy something in a file — `Ctrl-Ins`, or `Ctrl-C` there — bring the terminal forward and press `Shift-Ins` (or **Edit ▸ Paste**). The text is typed into the shell with an Enter for each line ending, so a multi-line paste runs line by line — unless the shell asked for bracketed paste, as `bash`, `zsh` and `fish` do, in which case it gets the whole block to edit before running. A paste from outside the editor into a terminal window is handed over the same way.
52+
53+A plain click drops a selection. Ctrl-Ins with nothing selected does nothing, and never reaches the shell.
54+
4055 ## Work with the file and the shell side by side
4156
4257 A terminal is an ordinary window, so the window commands all apply to it:
@@ -37,6 +37,21 @@ What the editor keeps is short, and deliberate — it is the way back out:
37 37
38 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.38 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.
39 39
40+## Copy from the terminal into a file, and back
41+
42+The shell keeps `Ctrl-C` and `Ctrl-V`, so the terminal uses the editor's other spelling of copy and paste — the one the Edit menu shows.
43+
44+**Out of the terminal.** Select what you want, then press `Ctrl-Ins` (or choose **Edit ▸ Copy**):
45+
46+- **With the mouse**, drag over the text. A drag that runs past the window's edge keeps selecting up to it.
47+- **With the keyboard**, `Shift-↑` and `Shift-↓` select whole lines, starting from the line the shell's cursor is on and growing a line at a time.
48+
49+The selection is highlighted, and the status bar says how many lines were copied. The text goes on the editor's clipboard and, if your terminal allows it, on the system's too. Switch to a file and press `Shift-Ins` to paste it. A window whose command has finished can still be selected and copied from.
50+
51+**Into the terminal.** Copy something in a file — `Ctrl-Ins`, or `Ctrl-C` there — bring the terminal forward and press `Shift-Ins` (or **Edit ▸ Paste**). The text is typed into the shell with an Enter for each line ending, so a multi-line paste runs line by line — unless the shell asked for bracketed paste, as `bash`, `zsh` and `fish` do, in which case it gets the whole block to edit before running. A paste from outside the editor into a terminal window is handed over the same way.
52+
53+A plain click drops a selection. Ctrl-Ins with nothing selected does nothing, and never reaches the shell.
54+
40 ## Work with the file and the shell side by side55 ## Work with the file and the shell side by side
41 56
42 A terminal is an ordinary window, so the window commands all apply to it:57 A terminal is an ordinary window, so the window commands all apply to it:
modified docs/en/reference/keyboard.md +4 -0
@@ -153,6 +153,9 @@ A terminal window in front gets **every key except** the function keys, `Alt-X`
153153 | Key | Action |
154154 | --- | --- |
155155 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
156+| `Shift-↑` `Shift-↓` | Select whole lines, from the shell's cursor line |
157+| `Ctrl-Ins` | Copy the selection (also **Edit ▸ Copy**) |
158+| `Shift-Ins` | Paste the editor's clipboard into the shell (also **Edit ▸ Paste**) |
156159 | anything else not reserved above | Sent to the shell, returning the view to the live screen |
157160
158161 The exact byte each key sends is in [Terminal windows](terminal.md).
@@ -185,4 +188,5 @@ Handled when the tree window has the focus. The full rules are in [Project tree]
185188 | Click `[■]` | Fill the desktop with the window |
186189 | Click `[▬]` | Put a filled window back where it was |
187190 | Wheel over a terminal | Scroll three lines through its history |
191+| Drag over a terminal | Select text; a click drops the selection |
188192 | Click a tree row | Highlight it; a second click opens it |
@@ -153,6 +153,9 @@ A terminal window in front gets **every key except** the function keys, `Alt-X`
153 | Key | Action |153 | Key | Action |
154 | --- | --- |154 | --- | --- |
155 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |155 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
156+| `Shift-↑` `Shift-↓` | Select whole lines, from the shell's cursor line |
157+| `Ctrl-Ins` | Copy the selection (also **Edit ▸ Copy**) |
158+| `Shift-Ins` | Paste the editor's clipboard into the shell (also **Edit ▸ Paste**) |
156 | anything else not reserved above | Sent to the shell, returning the view to the live screen |159 | anything else not reserved above | Sent to the shell, returning the view to the live screen |
157 160
158 The exact byte each key sends is in [Terminal windows](terminal.md).161 The exact byte each key sends is in [Terminal windows](terminal.md).
@@ -185,4 +188,5 @@ Handled when the tree window has the focus. The full rules are in [Project tree]
185 | Click `[■]` | Fill the desktop with the window |188 | Click `[■]` | Fill the desktop with the window |
186 | Click `[▬]` | Put a filled window back where it was |189 | Click `[▬]` | Put a filled window back where it was |
187 | Wheel over a terminal | Scroll three lines through its history |190 | Wheel over a terminal | Scroll three lines through its history |
191+| Drag over a terminal | Select text; a click drops the selection |
188 | Click a tree row | Highlight it; a second click opens it |192 | Click a tree row | Highlight it; a second click opens it |
modified docs/en/reference/languages.md +32 -9
@@ -13,6 +13,7 @@ A file's **extension** decides whenever it is one of these:
1313 | `.toml` | TOML |
1414 | `.yaml`, `.yml` | YAML |
1515 | `.md`, `.markdown` | Markdown |
16+| `.adoc`, `.asciidoc` | AsciiDoc |
1617 | `.html`, `.htm` | HTML |
1718 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
1819 | `.sh`, `.bash`, `.zsh` | Shell |
@@ -51,22 +52,22 @@ Every scanner produces the same vocabulary of classes, and each maps to one them
5152 | Class | Theme key | Produced by |
5253 | --- | --- | --- |
5354 | `identifier` | `syntax.identifier` | JavaScript, JSON (a bare word, which is not JSON), TOML, shell, YAML, Dockerfile |
54-| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile |
55+| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
5556 | `type` | `syntax.type` | JavaScript (class names and capitalised names), TOML (table headers), YAML (tags) |
5657 | `builtin` | `syntax.builtin` | JavaScript (the standard library's and Node's globals), shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |
57-| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML and XML (entities) |
58+| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML and XML (entities), AsciiDoc |
5859 | `function` | `syntax.function` | JavaScript, shell (the command) |
59-| `string` | `syntax.string` | all |
60+| `string` | `syntax.string` | all, AsciiDoc |
6061 | `char` | `syntax.char` | JavaScript (regular-expression literals) |
6162 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |
62-| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile |
63+| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
6364 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (block scalar headers), XML, Dockerfile |
64-| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile |
65-| `heading` | `syntax.heading` | Markdown |
65+| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile, AsciiDoc |
66+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
6667 | `tag` | `syntax.tag` | HTML, XML |
67-| `attribute` | `syntax.attribute` | JSON (keys), JavaScript (decorators), HTML, XML, Dockerfile (flags) |
68-| `emphasis` | `syntax.emphasis` | Markdown |
69-| `link` | `syntax.link` | Markdown |
68+| `attribute` | `syntax.attribute` | JSON (keys), JavaScript (decorators), HTML, XML, Dockerfile (flags), AsciiDoc |
69+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
70+| `link` | `syntax.link` | Markdown, AsciiDoc |
7071
7172 JavaScript produces no `heading`, `tag`, `emphasis` or `link` span. In `turbo-classic`, `syntax.number` and `syntax.constant` are both magenta and `syntax.char` is the green of `syntax.string`, so `42` and `true` share a colour there and so do `/re/` and `"re"`; other themes separate them. See [how to write your own theme](../how-to/write-a-theme.md) if you want to change it.
7273
@@ -206,6 +207,28 @@ A fenced block is **one colour whatever language it announces**: ```` ```javascr
206207
207208 The run of markers opening emphasis must be matched by a run of the same length, so `**bold**` is one span rather than two italics.
208209
210+## AsciiDoc
211+
212+| Recognised | As |
213+| --- | --- |
214+| `= Title` … `====== Title`, and `# Title` … `###### Title` | the whole line as a heading |
215+| `*bold*`, `**bold**`, `_italic_`, `__italic__` | emphasis |
216+| `` `mono` `` | string |
217+| `https://…`, `link:…[text]`, `xref:…[text]`, `mailto:…[]`, `image:…[]`, `<<anchor>>`, `<<anchor,text>>` | the whole thing as a link |
218+| `image::…[]`, `include::…[]`, `toc::[]` on a line of their own | the whole line as a link |
219+| `{attribute}` | constant |
220+| `:name: value`, `:name!:` | the `:name:` as attribute; the value as prose |
221+| `[source,go]`, `[NOTE]`, `[[anchor]]` on a line of their own | the whole line as attribute |
222+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | the label as keyword |
223+| `.Block title` | emphasis |
224+| `* `, `** `, `- `, `. `, `.. `, `1. ` | the marker as punctuation |
225+| `====`, `****`, `____`, `--`, `|===` | punctuation; the lines between them are prose |
226+| `|` in a table row | punctuation; the cells are prose |
227+| `----`, `....`, `++++` blocks | the whole block, delimiters included, as a string |
228+| `////` blocks and `//` lines | comment |
229+
230+A verbatim block is **one colour whatever its `[source]` says**, and it closes only on a delimiter of the **same length** — AsciiDoc's own rule, and what lets a listing contain a line of dashes. An unclosed one colours to the end of the file. Bold, italic and monospace follow the Markdown rules above, marker runs matched by length. Not recognised: literal paragraphs (indented lines), description lists (`term:: text`), `+passthrough+`, `#highlight#` — and `.asc` files, which are PGP signatures as often as documents.
231+
209232 ## HTML
210233
211234 | Recognised | As |
@@ -13,6 +13,7 @@ A file's **extension** decides whenever it is one of these:
13 | `.toml` | TOML |13 | `.toml` | TOML |
14 | `.yaml`, `.yml` | YAML |14 | `.yaml`, `.yml` | YAML |
15 | `.md`, `.markdown` | Markdown |15 | `.md`, `.markdown` | Markdown |
16+| `.adoc`, `.asciidoc` | AsciiDoc |
16 | `.html`, `.htm` | HTML |17 | `.html`, `.htm` | HTML |
17 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |18 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
18 | `.sh`, `.bash`, `.zsh` | Shell |19 | `.sh`, `.bash`, `.zsh` | Shell |
@@ -51,22 +52,22 @@ Every scanner produces the same vocabulary of classes, and each maps to one them
51 | Class | Theme key | Produced by |52 | Class | Theme key | Produced by |
52 | --- | --- | --- |53 | --- | --- | --- |
53 | `identifier` | `syntax.identifier` | JavaScript, JSON (a bare word, which is not JSON), TOML, shell, YAML, Dockerfile |54 | `identifier` | `syntax.identifier` | JavaScript, JSON (a bare word, which is not JSON), TOML, shell, YAML, Dockerfile |
54-| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile |55+| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
55 | `type` | `syntax.type` | JavaScript (class names and capitalised names), TOML (table headers), YAML (tags) |56 | `type` | `syntax.type` | JavaScript (class names and capitalised names), TOML (table headers), YAML (tags) |
56 | `builtin` | `syntax.builtin` | JavaScript (the standard library's and Node's globals), shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |57 | `builtin` | `syntax.builtin` | JavaScript (the standard library's and Node's globals), shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |
57-| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML and XML (entities) |58+| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML and XML (entities), AsciiDoc |
58 | `function` | `syntax.function` | JavaScript, shell (the command) |59 | `function` | `syntax.function` | JavaScript, shell (the command) |
59-| `string` | `syntax.string` | all |60+| `string` | `syntax.string` | all, AsciiDoc |
60 | `char` | `syntax.char` | JavaScript (regular-expression literals) |61 | `char` | `syntax.char` | JavaScript (regular-expression literals) |
61 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |62 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |
62-| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile |63+| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
63 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (block scalar headers), XML, Dockerfile |64 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (block scalar headers), XML, Dockerfile |
64-| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile |65+| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile, AsciiDoc |
65-| `heading` | `syntax.heading` | Markdown |66+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
66 | `tag` | `syntax.tag` | HTML, XML |67 | `tag` | `syntax.tag` | HTML, XML |
67-| `attribute` | `syntax.attribute` | JSON (keys), JavaScript (decorators), HTML, XML, Dockerfile (flags) |68+| `attribute` | `syntax.attribute` | JSON (keys), JavaScript (decorators), HTML, XML, Dockerfile (flags), AsciiDoc |
68-| `emphasis` | `syntax.emphasis` | Markdown |69+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
69-| `link` | `syntax.link` | Markdown |70+| `link` | `syntax.link` | Markdown, AsciiDoc |
70 71
71 JavaScript produces no `heading`, `tag`, `emphasis` or `link` span. In `turbo-classic`, `syntax.number` and `syntax.constant` are both magenta and `syntax.char` is the green of `syntax.string`, so `42` and `true` share a colour there and so do `/re/` and `"re"`; other themes separate them. See [how to write your own theme](../how-to/write-a-theme.md) if you want to change it.72 JavaScript produces no `heading`, `tag`, `emphasis` or `link` span. In `turbo-classic`, `syntax.number` and `syntax.constant` are both magenta and `syntax.char` is the green of `syntax.string`, so `42` and `true` share a colour there and so do `/re/` and `"re"`; other themes separate them. See [how to write your own theme](../how-to/write-a-theme.md) if you want to change it.
72 73
@@ -206,6 +207,28 @@ A fenced block is **one colour whatever language it announces**: ```` ```javascr
206 207
207 The run of markers opening emphasis must be matched by a run of the same length, so `**bold**` is one span rather than two italics.208 The run of markers opening emphasis must be matched by a run of the same length, so `**bold**` is one span rather than two italics.
208 209
210+## AsciiDoc
211+
212+| Recognised | As |
213+| --- | --- |
214+| `= Title` … `====== Title`, and `# Title` … `###### Title` | the whole line as a heading |
215+| `*bold*`, `**bold**`, `_italic_`, `__italic__` | emphasis |
216+| `` `mono` `` | string |
217+| `https://…`, `link:…[text]`, `xref:…[text]`, `mailto:…[]`, `image:…[]`, `<<anchor>>`, `<<anchor,text>>` | the whole thing as a link |
218+| `image::…[]`, `include::…[]`, `toc::[]` on a line of their own | the whole line as a link |
219+| `{attribute}` | constant |
220+| `:name: value`, `:name!:` | the `:name:` as attribute; the value as prose |
221+| `[source,go]`, `[NOTE]`, `[[anchor]]` on a line of their own | the whole line as attribute |
222+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | the label as keyword |
223+| `.Block title` | emphasis |
224+| `* `, `** `, `- `, `. `, `.. `, `1. ` | the marker as punctuation |
225+| `====`, `****`, `____`, `--`, `|===` | punctuation; the lines between them are prose |
226+| `|` in a table row | punctuation; the cells are prose |
227+| `----`, `....`, `++++` blocks | the whole block, delimiters included, as a string |
228+| `////` blocks and `//` lines | comment |
229+
230+A verbatim block is **one colour whatever its `[source]` says**, and it closes only on a delimiter of the **same length** — AsciiDoc's own rule, and what lets a listing contain a line of dashes. An unclosed one colours to the end of the file. Bold, italic and monospace follow the Markdown rules above, marker runs matched by length. Not recognised: literal paragraphs (indented lines), description lists (`term:: text`), `+passthrough+`, `#highlight#` — and `.asc` files, which are PGP signatures as often as documents.
231+
209 ## HTML232 ## HTML
210 233
211 | Recognised | As |234 | Recognised | As |
modified docs/en/reference/terminal.md +25 -4
@@ -35,7 +35,7 @@ Neither requires a file to be open. A tool in `.turbo-js/tools.toml` whose `outp
3535
3636 ### After the program has gone
3737
38-A window whose command has finished keeps its output, but stops behaving like a terminal: only `Shift-PgUp` and `Shift-PgDn` are still taken, and every other key reaches the editor — which is what lets `Ctrl-W` close it.
38+A window whose command has finished keeps its output, but stops behaving like a terminal: only the history and selection keys — `Shift-PgUp`, `Shift-PgDn`, `Shift-↑`, `Shift-↓`, `Ctrl-Ins` and `Shift-Ins` — are still taken, so what it printed can still be selected and copied (nothing can be pasted into it), and every other key reaches the editor — which is what lets `Ctrl-W` close it.
3939
4040 ### Sent to the shell
4141
@@ -76,18 +76,37 @@ Function keys therefore never reach a program inside a terminal window.
7676 | --- | --- |
7777 | `Shift-PgUp` | Back one screenful through the history |
7878 | `Shift-PgDn` | Forward one screenful |
79+| `Shift-↑` `Shift-↓` | Select whole lines: from the shell's cursor line with nothing selected, otherwise one more line up or down. A mouse selection becomes whole lines |
80+| `Ctrl-Ins` | Copy the selection to the editor's clipboard and the system's, and drop it. Claimed even with nothing selected, so it never reaches the shell as `Insert` |
81+| `Shift-Ins` | Type the editor's clipboard into the shell (see [Copying and pasting](#copying-and-pasting)). Claimed even when the clipboard is empty |
7982
80-Any key sent to the shell also returns the view to the live screen.
83+Any key sent to the shell also returns the view to the live screen. `Shift-↑` and `Shift-↓` therefore never reach a program: a program that wanted them gets nothing.
8184
8285 ## Mouse
8386
8487 | Action | Effect |
8588 | --- | --- |
8689 | Wheel up / down | Scroll three lines through the history |
87-| Click | Brings the window forward; not forwarded to the program |
90+| Click | Brings the window forward and drops any selection; not forwarded to the program |
91+| Drag with the left button | Selects the text between the press and the pointer, character by character across lines. Dragging past the window's edge selects up to that edge |
8892
8993 Mouse reporting is not implemented, so a program is never told about clicks.
9094
95+## Copying and pasting
96+
97+| Property | Value |
98+| --- | --- |
99+| Selection | Two cells of the whole text — history and live screen together — so it stays on the same text while the shell writes below it |
100+| Highlight | The theme's `editor.selection`, replacing the program's colours inside the selection |
101+| Copied text | The selected cells, lines joined with `\n`. A line selected to its right edge loses its trailing blanks; one selected short of the edge keeps every blank chosen |
102+| Copy goes to | The editor's clipboard, and the system's through OSC 52 (unverified: the terminal may refuse it) |
103+| Status bar | `Copied N lines` |
104+| Pasted text | Each `\n` or `\r\n` becomes `\r`, as `Enter` sends. With private mode 2004 on, the whole is wrapped in `ESC [ 200 ~` … `ESC [ 201 ~` |
105+| Sources of a paste | `Shift-Ins` and **Edit ▸ Paste** (the editor's clipboard); a bracketed paste from the terminal the editor runs in, handed over whole |
106+| Selection dropped by | A copy, a paste, a click, a new drag |
107+| Selection kept across | Output arriving, scrolling, keys sent to the shell |
108+| Not selectable | Nothing: the alternate screen and a finished window can both be selected from |
109+
91110 ## History
92111
93112 | Property | Value |
@@ -157,6 +176,7 @@ Set with `CSI ? n h`, cleared with `CSI ? n l`.
157176 | 47, 1047 | | Alternate screen |
158177 | 1048 | | Save / restore the cursor |
159178 | 1049 | | Save the cursor, then the alternate screen |
179+| 2004 | | Bracketed paste: a paste into the window is wrapped in `ESC [ 200 ~` … `ESC [ 201 ~` |
160180
161181 Any other mode is parsed and ignored.
162182
@@ -202,7 +222,7 @@ Parsed correctly, so they never appear as stray characters, but with no effect:
202222
203223 ### Not implemented
204224
205-Mouse reporting, bracketed paste, shift-in / shift-out, double-width lines, sixel and other graphics protocols, and the DEC status and device-attribute reports. A program that asks for one of these gets no reply, so a program that waits for one waits forever.
225+Mouse reporting, shift-in / shift-out, double-width lines, sixel and other graphics protocols, and the DEC status and device-attribute reports. A program that asks for one of these gets no reply, so a program that waits for one waits forever.
206226
207227 ## Colours
208228
@@ -210,6 +230,7 @@ Mouse reporting, bracketed paste, shift-in / shift-out, double-width lines, sixe
210230 | --- | --- |
211231 | `terminal.text` | Every cell whose colour the program did not choose |
212232 | `terminal.cursor` | The cell under the cursor, when the window has the focus |
233+| `editor.selection` | The selected cells — the same colour as a selection in a file |
213234
214235 See [Theme file format](themes.md).
215236
@@ -35,7 +35,7 @@ Neither requires a file to be open. A tool in `.turbo-js/tools.toml` whose `outp
35 35
36 ### After the program has gone36 ### After the program has gone
37 37
38-A window whose command has finished keeps its output, but stops behaving like a terminal: only `Shift-PgUp` and `Shift-PgDn` are still taken, and every other key reaches the editor — which is what lets `Ctrl-W` close it.38+A window whose command has finished keeps its output, but stops behaving like a terminal: only the history and selection keys — `Shift-PgUp`, `Shift-PgDn`, `Shift-↑`, `Shift-↓`, `Ctrl-Ins` and `Shift-Ins` — are still taken, so what it printed can still be selected and copied (nothing can be pasted into it), and every other key reaches the editor — which is what lets `Ctrl-W` close it.
39 39
40 ### Sent to the shell40 ### Sent to the shell
41 41
@@ -76,18 +76,37 @@ Function keys therefore never reach a program inside a terminal window.
76 | --- | --- |76 | --- | --- |
77 | `Shift-PgUp` | Back one screenful through the history |77 | `Shift-PgUp` | Back one screenful through the history |
78 | `Shift-PgDn` | Forward one screenful |78 | `Shift-PgDn` | Forward one screenful |
79+| `Shift-↑` `Shift-↓` | Select whole lines: from the shell's cursor line with nothing selected, otherwise one more line up or down. A mouse selection becomes whole lines |
80+| `Ctrl-Ins` | Copy the selection to the editor's clipboard and the system's, and drop it. Claimed even with nothing selected, so it never reaches the shell as `Insert` |
81+| `Shift-Ins` | Type the editor's clipboard into the shell (see [Copying and pasting](#copying-and-pasting)). Claimed even when the clipboard is empty |
79 82
80-Any key sent to the shell also returns the view to the live screen.83+Any key sent to the shell also returns the view to the live screen. `Shift-↑` and `Shift-↓` therefore never reach a program: a program that wanted them gets nothing.
81 84
82 ## Mouse85 ## Mouse
83 86
84 | Action | Effect |87 | Action | Effect |
85 | --- | --- |88 | --- | --- |
86 | Wheel up / down | Scroll three lines through the history |89 | Wheel up / down | Scroll three lines through the history |
87-| Click | Brings the window forward; not forwarded to the program |90+| Click | Brings the window forward and drops any selection; not forwarded to the program |
91+| Drag with the left button | Selects the text between the press and the pointer, character by character across lines. Dragging past the window's edge selects up to that edge |
88 92
89 Mouse reporting is not implemented, so a program is never told about clicks.93 Mouse reporting is not implemented, so a program is never told about clicks.
90 94
95+## Copying and pasting
96+
97+| Property | Value |
98+| --- | --- |
99+| Selection | Two cells of the whole text — history and live screen together — so it stays on the same text while the shell writes below it |
100+| Highlight | The theme's `editor.selection`, replacing the program's colours inside the selection |
101+| Copied text | The selected cells, lines joined with `\n`. A line selected to its right edge loses its trailing blanks; one selected short of the edge keeps every blank chosen |
102+| Copy goes to | The editor's clipboard, and the system's through OSC 52 (unverified: the terminal may refuse it) |
103+| Status bar | `Copied N lines` |
104+| Pasted text | Each `\n` or `\r\n` becomes `\r`, as `Enter` sends. With private mode 2004 on, the whole is wrapped in `ESC [ 200 ~` … `ESC [ 201 ~` |
105+| Sources of a paste | `Shift-Ins` and **Edit ▸ Paste** (the editor's clipboard); a bracketed paste from the terminal the editor runs in, handed over whole |
106+| Selection dropped by | A copy, a paste, a click, a new drag |
107+| Selection kept across | Output arriving, scrolling, keys sent to the shell |
108+| Not selectable | Nothing: the alternate screen and a finished window can both be selected from |
109+
91 ## History110 ## History
92 111
93 | Property | Value |112 | Property | Value |
@@ -157,6 +176,7 @@ Set with `CSI ? n h`, cleared with `CSI ? n l`.
157 | 47, 1047 | | Alternate screen |176 | 47, 1047 | | Alternate screen |
158 | 1048 | | Save / restore the cursor |177 | 1048 | | Save / restore the cursor |
159 | 1049 | | Save the cursor, then the alternate screen |178 | 1049 | | Save the cursor, then the alternate screen |
179+| 2004 | | Bracketed paste: a paste into the window is wrapped in `ESC [ 200 ~` … `ESC [ 201 ~` |
160 180
161 Any other mode is parsed and ignored.181 Any other mode is parsed and ignored.
162 182
@@ -202,7 +222,7 @@ Parsed correctly, so they never appear as stray characters, but with no effect:
202 222
203 ### Not implemented223 ### Not implemented
204 224
205-Mouse reporting, bracketed paste, shift-in / shift-out, double-width lines, sixel and other graphics protocols, and the DEC status and device-attribute reports. A program that asks for one of these gets no reply, so a program that waits for one waits forever.225+Mouse reporting, shift-in / shift-out, double-width lines, sixel and other graphics protocols, and the DEC status and device-attribute reports. A program that asks for one of these gets no reply, so a program that waits for one waits forever.
206 226
207 ## Colours227 ## Colours
208 228
@@ -210,6 +230,7 @@ Mouse reporting, bracketed paste, shift-in / shift-out, double-width lines, sixe
210 | --- | --- |230 | --- | --- |
211 | `terminal.text` | Every cell whose colour the program did not choose |231 | `terminal.text` | Every cell whose colour the program did not choose |
212 | `terminal.cursor` | The cell under the cursor, when the window has the focus |232 | `terminal.cursor` | The cell under the cursor, when the window has the focus |
233+| `editor.selection` | The selected cells — the same colour as a selection in a file |
213 234
214 See [Theme file format](themes.md).235 See [Theme file format](themes.md).
215 236
modified docs/en/reference/themes.md +1 -1
@@ -177,7 +177,7 @@ These are separate from the `list.*` keys on purpose: a dialog's list is coloure
177177
178178 ### Syntax
179179
180-The examples are JavaScript's; the other eight languages map their own constructs onto the same classes.
180+The examples are JavaScript's; the other nine languages map their own constructs onto the same classes.
181181
182182 | Key | What it colours |
183183 | --- | --- |
@@ -177,7 +177,7 @@ These are separate from the `list.*` keys on purpose: a dialog's list is coloure
177 177
178 ### Syntax178 ### Syntax
179 179
180-The examples are JavaScript's; the other eight languages map their own constructs onto the same classes.180+The examples are JavaScript's; the other nine languages map their own constructs onto the same classes.
181 181
182 | Key | What it colours |182 | Key | What it colours |
183 | --- | --- |183 | --- | --- |
modified docs/fr/explanation/architecture.md +2 -2
@@ -57,7 +57,7 @@ Tout ce qui serait sinon un `"turbo-js"`, un `"node"` ou un `".js"` codé en dur
5757
5858 ## Pourquoi le scanner JavaScript est ici alors que la bibliothèque en a un
5959
60-turbo-core colore huit langages lui-même : TOML, YAML, Markdown, JavaScript, HTML, XML, les Dockerfiles et le shell. Ce sont ceux que tout éditeur rencontre quel que soit son langage — la configuration d'un projet est en TOML ou en YAML, sa documentation en Markdown, ses scripts en shell, la construction de son image dans un Dockerfile, et une page web ou le bloc de code d'un README est en JavaScript.
60+turbo-core colore neuf langages lui-même : TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, les Dockerfiles et le shell. Ce sont ceux que tout éditeur rencontre quel que soit son langage — la configuration d'un projet est en TOML ou en YAML, sa documentation en Markdown, ses scripts en shell, la construction de son image dans un Dockerfile, et une page web ou le bloc de code d'un README est en JavaScript.
6161
6262 JavaScript est donc le seul langage de cette famille que la bibliothèque colore *et* pour lequel un éditeur existe. Le scanner de la bibliothèque est écrit pour le README de l'éditeur Rust : il connaît les mots-clés, les chaînes, les commentaires et les nombres, et il refuse délibérément les expressions régulières, parce que distinguer `/x/g` d'une division exige le token précédent, et qu'une mauvaise supposition à cet endroit colore le reste d'une ligne comme une chaîne — un mauvais marché pour un langage qu'on ne rencontre qu'en passant. Un éditeur *pour* JavaScript fait le marché inverse : les expressions régulières sont une ligne sur deux dans un programme Node, et la supposition peut être bornée. Il doit aussi à son utilisateur les globales de Node, la ligne shebang, le nom après `function`, les noms privés et les décorateurs.
6363
@@ -65,7 +65,7 @@ La bibliothèque permet exactement cela. `syntax.Register` remplace un langage e
6565
6666 ## Pourquoi JSON est ici aussi
6767
68-JSON n'est pas l'un des huit de la bibliothèque, et un projet Node ne peut pas s'éditer sans lui : `package.json` est le manifeste et le marqueur de racine, `package-lock.json` est à côté, `tsconfig.json` et `.eslintrc.json` sont des voisins courants. L'éditeur qui est pour Node enregistre donc un scanner JSON, trente lignes, qui distingue une clé d'une valeur et tolère les commentaires que `tsconfig.json` contient.
68+JSON n'est pas l'un des neuf de la bibliothèque, et un projet Node ne peut pas s'éditer sans lui : `package.json` est le manifeste et le marqueur de racine, `package-lock.json` est à côté, `tsconfig.json` et `.eslintrc.json` sont des voisins courants. L'éditeur qui est pour Node enregistre donc un scanner JSON, trente lignes, qui distingue une clé d'une valeur et tolère les commentaires que `tsconfig.json` contient.
6969
7070 Cela aurait pu aller dans la bibliothèque à la place — un éditeur Go rencontre aussi un `package.json`, dans un dépôt qui a un front-end. Cela n'a pas été fait, pour la raison qui tient les scanners Go et Rust hors de la bibliothèque : elle grossirait d'un langage chaque fois que quelqu'un en veut un, et « qu'est-ce que cet éditeur enregistre ? » cesserait d'être la première question à poser sur un nouveau venu. Si turbo-core apprend JSON un jour, cet enregistrement l'emportera toujours par l'ordre, et celui d'ici pourra alors être retiré.
7171
@@ -57,7 +57,7 @@ Tout ce qui serait sinon un `"turbo-js"`, un `"node"` ou un `".js"` codé en dur
57 57
58 ## Pourquoi le scanner JavaScript est ici alors que la bibliothèque en a un58 ## Pourquoi le scanner JavaScript est ici alors que la bibliothèque en a un
59 59
60-turbo-core colore huit langages lui-même : TOML, YAML, Markdown, JavaScript, HTML, XML, les Dockerfiles et le shell. Ce sont ceux que tout éditeur rencontre quel que soit son langage — la configuration d'un projet est en TOML ou en YAML, sa documentation en Markdown, ses scripts en shell, la construction de son image dans un Dockerfile, et une page web ou le bloc de code d'un README est en JavaScript.60+turbo-core colore neuf langages lui-même : TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, les Dockerfiles et le shell. Ce sont ceux que tout éditeur rencontre quel que soit son langage — la configuration d'un projet est en TOML ou en YAML, sa documentation en Markdown, ses scripts en shell, la construction de son image dans un Dockerfile, et une page web ou le bloc de code d'un README est en JavaScript.
61 61
62 JavaScript est donc le seul langage de cette famille que la bibliothèque colore *et* pour lequel un éditeur existe. Le scanner de la bibliothèque est écrit pour le README de l'éditeur Rust : il connaît les mots-clés, les chaînes, les commentaires et les nombres, et il refuse délibérément les expressions régulières, parce que distinguer `/x/g` d'une division exige le token précédent, et qu'une mauvaise supposition à cet endroit colore le reste d'une ligne comme une chaîne — un mauvais marché pour un langage qu'on ne rencontre qu'en passant. Un éditeur *pour* JavaScript fait le marché inverse : les expressions régulières sont une ligne sur deux dans un programme Node, et la supposition peut être bornée. Il doit aussi à son utilisateur les globales de Node, la ligne shebang, le nom après `function`, les noms privés et les décorateurs.62 JavaScript est donc le seul langage de cette famille que la bibliothèque colore *et* pour lequel un éditeur existe. Le scanner de la bibliothèque est écrit pour le README de l'éditeur Rust : il connaît les mots-clés, les chaînes, les commentaires et les nombres, et il refuse délibérément les expressions régulières, parce que distinguer `/x/g` d'une division exige le token précédent, et qu'une mauvaise supposition à cet endroit colore le reste d'une ligne comme une chaîne — un mauvais marché pour un langage qu'on ne rencontre qu'en passant. Un éditeur *pour* JavaScript fait le marché inverse : les expressions régulières sont une ligne sur deux dans un programme Node, et la supposition peut être bornée. Il doit aussi à son utilisateur les globales de Node, la ligne shebang, le nom après `function`, les noms privés et les décorateurs.
63 63
@@ -65,7 +65,7 @@ La bibliothèque permet exactement cela. `syntax.Register` remplace un langage e
65 65
66 ## Pourquoi JSON est ici aussi66 ## Pourquoi JSON est ici aussi
67 67
68-JSON n'est pas l'un des huit de la bibliothèque, et un projet Node ne peut pas s'éditer sans lui : `package.json` est le manifeste et le marqueur de racine, `package-lock.json` est à côté, `tsconfig.json` et `.eslintrc.json` sont des voisins courants. L'éditeur qui est pour Node enregistre donc un scanner JSON, trente lignes, qui distingue une clé d'une valeur et tolère les commentaires que `tsconfig.json` contient.68+JSON n'est pas l'un des neuf de la bibliothèque, et un projet Node ne peut pas s'éditer sans lui : `package.json` est le manifeste et le marqueur de racine, `package-lock.json` est à côté, `tsconfig.json` et `.eslintrc.json` sont des voisins courants. L'éditeur qui est pour Node enregistre donc un scanner JSON, trente lignes, qui distingue une clé d'une valeur et tolère les commentaires que `tsconfig.json` contient.
69 69
70 Cela aurait pu aller dans la bibliothèque à la place — un éditeur Go rencontre aussi un `package.json`, dans un dépôt qui a un front-end. Cela n'a pas été fait, pour la raison qui tient les scanners Go et Rust hors de la bibliothèque : elle grossirait d'un langage chaque fois que quelqu'un en veut un, et « qu'est-ce que cet éditeur enregistre ? » cesserait d'être la première question à poser sur un nouveau venu. Si turbo-core apprend JSON un jour, cet enregistrement l'emportera toujours par l'ordre, et celui d'ici pourra alors être retiré.70 Cela aurait pu aller dans la bibliothèque à la place — un éditeur Go rencontre aussi un `package.json`, dans un dépôt qui a un front-end. Cela n'a pas été fait, pour la raison qui tient les scanners Go et Rust hors de la bibliothèque : elle grossirait d'un langage chaque fois que quelqu'un en veut un, et « qu'est-ce que cet éditeur enregistre ? » cesserait d'être la première question à poser sur un nouveau venu. Si turbo-core apprend JSON un jour, cet enregistrement l'emportera toujours par l'ordre, et celui d'ici pourra alors être retiré.
71 71
modified docs/fr/explanation/colouring-and-completion.md +1 -1
@@ -69,7 +69,7 @@ Il est enregistré sous son propre nom, `json`, si bien qu'un bloc ```json dans
6969
7070 ## Les sept autres langages viennent gratuitement
7171
72-TOML, YAML, Markdown, HTML, XML, les Dockerfiles et le shell sont colorés par turbo-core, pas ici. Un projet Node a un `README.md`, un `compose.yaml` pour la base de données à laquelle il parle, un `Dockerfile` pour être livré, un `.github/workflows/ci.yml`, et un éditeur qui ne colorerait que les fichiers `.js` vous ferait le quitter pour le reste.
72+TOML, YAML, Markdown, AsciiDoc, HTML, XML, les Dockerfiles et le shell sont colorés par turbo-core, pas ici. Un projet Node a un `README.md`, un `compose.yaml` pour la base de données à laquelle il parle, un `Dockerfile` pour être livré, un `.github/workflows/ci.yml`, et un éditeur qui ne colorerait que les fichiers `.js` vous ferait le quitter pour le reste.
7373
7474 Qu'ils soient partagés plutôt que copiés est tout l'intérêt de la bibliothèque : ils ont été écrits une fois, pour Turbo Go, et Turbo JS les a obtenus en important un paquet. JavaScript est le huitième, et cet éditeur l'a repris plutôt que d'en hériter.
7575
@@ -69,7 +69,7 @@ Il est enregistré sous son propre nom, `json`, si bien qu'un bloc ```json dans
69 69
70 ## Les sept autres langages viennent gratuitement70 ## Les sept autres langages viennent gratuitement
71 71
72-TOML, YAML, Markdown, HTML, XML, les Dockerfiles et le shell sont colorés par turbo-core, pas ici. Un projet Node a un `README.md`, un `compose.yaml` pour la base de données à laquelle il parle, un `Dockerfile` pour être livré, un `.github/workflows/ci.yml`, et un éditeur qui ne colorerait que les fichiers `.js` vous ferait le quitter pour le reste.72+TOML, YAML, Markdown, AsciiDoc, HTML, XML, les Dockerfiles et le shell sont colorés par turbo-core, pas ici. Un projet Node a un `README.md`, un `compose.yaml` pour la base de données à laquelle il parle, un `Dockerfile` pour être livré, un `.github/workflows/ci.yml`, et un éditeur qui ne colorerait que les fichiers `.js` vous ferait le quitter pour le reste.
73 73
74 Qu'ils soient partagés plutôt que copiés est tout l'intérêt de la bibliothèque : ils ont été écrits une fois, pour Turbo Go, et Turbo JS les a obtenus en important un paquet. JavaScript est le huitième, et cet éditeur l'a repris plutôt que d'en hériter.74 Qu'ils soient partagés plutôt que copiés est tout l'intérêt de la bibliothèque : ils ont été écrits une fois, pour Turbo Go, et Turbo JS les a obtenus en important un paquet. JavaScript est le huitième, et cet éditeur l'a repris plutôt que d'en hériter.
75 75
modified docs/fr/explanation/terminal-windows.md +8 -0
@@ -38,6 +38,14 @@ Ces exceptions ne sont pas un compromis entre les deux revendications — ce son
3838
3939 Ce que cela coûte est réel et mérite d'être nommé : `Alt-B` et `Alt-F` atteignent le shell, donc le déplacement par mot de readline fonctionne, mais un programme dans une fenêtre terminal ne verra jamais `F1`…`F12`. Le menu par touches de fonction de `htop` est inaccessible. C'est l'arbitrage, et il a été rendu en faveur du fait de toujours pouvoir sortir.
4040
41+## Copier vers l'extérieur, coller vers l'intérieur
42+
43+La sortie d'un terminal est voulue ailleurs aussi souvent qu'elle est lue : un chemin tiré d'une erreur de compilation, une ligne d'une trace, le résultat d'une commande à coller dans le fichier voisin. Et dans l'autre sens, une commande écrite dans un fichier et voulue à l'invite. Les deux touches évidentes sont indisponibles, et la section précédente dit pourquoi : `Ctrl-C` interrompt et `Ctrl-V` est le quoted-insert de readline, et un terminal qui prendrait l'une ou l'autre serait un moins bon terminal. Le terminal a donc l'*autre* orthographe des deux mêmes commandes dans l'éditeur, `Ctrl-Inser` et `Maj-Inser`, que le menu Édition affiche déjà et dont aucun shell n'a l'usage — transmises, elles arriveraient l'une comme l'autre en simple `Insert` et basculeraient le mode écrasement.
44+
45+La sélection est mémorisée comme deux cellules du texte entier, historique et écran vivant réunis, plutôt que comme des positions d'écran. C'est ce qui lui permet de survivre à ce que le shell écrit en dessous : une ligne qui sort par le haut vers l'historique garde son indice, parce que l'historique grandit exactement de la ligne que l'écran a perdue. La sélection au clavier se fait par lignes entières, comme dans la fenêtre agent et pour la même raison — rien n'est édité ici, et une ligne entière est presque toujours ce qu'on voulait ; la souris sélectionne au caractère parce qu'un chemin au milieu d'une ligne est l'autre chose que l'on veut. La copie va dans les deux presse-papiers, celui de l'éditeur et celui du système, là encore comme dans la fenêtre agent et pour la même raison : « copie ça » depuis un terminal veut généralement dire l'emporter tout à fait hors de l'éditeur.
46+
47+Le collage est le seul endroit où la frontière de l'émulateur a bougé. Un collage est tapé dans le shell avec `Entrée` pour chaque fin de ligne, ce que fait un terminal ; mais `bash`, `zsh` et `fish` demandent tous le *collage entre crochets* — le mode privé 2004 — précisément pour qu'un collage multiligne arrive comme un bloc à éditer plutôt que comme des lignes à exécuter. L'émulateur ignorait ce mode avec les autres. Il le mémorise désormais, et rien de plus : il ne colle toujours jamais de lui-même, mais quand l'éditeur colle pour le compte de l'utilisateur, il peut encadrer le texte des marques demandées par le shell. Un collage venu de l'extérieur de l'éditeur dans une fenêtre terminal est transmis de la même façon, entier, plutôt que rejoué touche par touche — la règle que suit déjà la zone de saisie de la fenêtre agent.
48+
4149 ## Pourquoi fermer un terminal ne demande rien
4250
4351 Fermer un fichier modifié demande s'il faut l'enregistrer. Fermer un terminal ne demande rien du tout, et cette asymétrie est délibérée.
@@ -38,6 +38,14 @@ Ces exceptions ne sont pas un compromis entre les deux revendications — ce son
38 38
39 Ce que cela coûte est réel et mérite d'être nommé : `Alt-B` et `Alt-F` atteignent le shell, donc le déplacement par mot de readline fonctionne, mais un programme dans une fenêtre terminal ne verra jamais `F1`…`F12`. Le menu par touches de fonction de `htop` est inaccessible. C'est l'arbitrage, et il a été rendu en faveur du fait de toujours pouvoir sortir.39 Ce que cela coûte est réel et mérite d'être nommé : `Alt-B` et `Alt-F` atteignent le shell, donc le déplacement par mot de readline fonctionne, mais un programme dans une fenêtre terminal ne verra jamais `F1`…`F12`. Le menu par touches de fonction de `htop` est inaccessible. C'est l'arbitrage, et il a été rendu en faveur du fait de toujours pouvoir sortir.
40 40
41+## Copier vers l'extérieur, coller vers l'intérieur
42+
43+La sortie d'un terminal est voulue ailleurs aussi souvent qu'elle est lue : un chemin tiré d'une erreur de compilation, une ligne d'une trace, le résultat d'une commande à coller dans le fichier voisin. Et dans l'autre sens, une commande écrite dans un fichier et voulue à l'invite. Les deux touches évidentes sont indisponibles, et la section précédente dit pourquoi : `Ctrl-C` interrompt et `Ctrl-V` est le quoted-insert de readline, et un terminal qui prendrait l'une ou l'autre serait un moins bon terminal. Le terminal a donc l'*autre* orthographe des deux mêmes commandes dans l'éditeur, `Ctrl-Inser` et `Maj-Inser`, que le menu Édition affiche déjà et dont aucun shell n'a l'usage — transmises, elles arriveraient l'une comme l'autre en simple `Insert` et basculeraient le mode écrasement.
44+
45+La sélection est mémorisée comme deux cellules du texte entier, historique et écran vivant réunis, plutôt que comme des positions d'écran. C'est ce qui lui permet de survivre à ce que le shell écrit en dessous : une ligne qui sort par le haut vers l'historique garde son indice, parce que l'historique grandit exactement de la ligne que l'écran a perdue. La sélection au clavier se fait par lignes entières, comme dans la fenêtre agent et pour la même raison — rien n'est édité ici, et une ligne entière est presque toujours ce qu'on voulait ; la souris sélectionne au caractère parce qu'un chemin au milieu d'une ligne est l'autre chose que l'on veut. La copie va dans les deux presse-papiers, celui de l'éditeur et celui du système, là encore comme dans la fenêtre agent et pour la même raison : « copie ça » depuis un terminal veut généralement dire l'emporter tout à fait hors de l'éditeur.
46+
47+Le collage est le seul endroit où la frontière de l'émulateur a bougé. Un collage est tapé dans le shell avec `Entrée` pour chaque fin de ligne, ce que fait un terminal ; mais `bash`, `zsh` et `fish` demandent tous le *collage entre crochets* — le mode privé 2004 — précisément pour qu'un collage multiligne arrive comme un bloc à éditer plutôt que comme des lignes à exécuter. L'émulateur ignorait ce mode avec les autres. Il le mémorise désormais, et rien de plus : il ne colle toujours jamais de lui-même, mais quand l'éditeur colle pour le compte de l'utilisateur, il peut encadrer le texte des marques demandées par le shell. Un collage venu de l'extérieur de l'éditeur dans une fenêtre terminal est transmis de la même façon, entier, plutôt que rejoué touche par touche — la règle que suit déjà la zone de saisie de la fenêtre agent.
48+
41 ## Pourquoi fermer un terminal ne demande rien49 ## Pourquoi fermer un terminal ne demande rien
42 50
43 Fermer un fichier modifié demande s'il faut l'enregistrer. Fermer un terminal ne demande rien du tout, et cette asymétrie est délibérée.51 Fermer un fichier modifié demande s'il faut l'enregistrer. Fermer un terminal ne demande rien du tout, et cette asymétrie est délibérée.
modified docs/fr/how-to/navigate-code.md +1 -1
@@ -60,7 +60,7 @@ Si les fenêtres se recouvrent, `Window ▸ Tile` les dispose côte à côte et
6060
6161 ## Variantes
6262
63-**Le fichier n'est pas du JavaScript.** Tout ce qui précède fonctionne sauf F12, qui a besoin d'un serveur de langage. La coloration dépend du langage : JavaScript — les fichiers `.js`, `.mjs` et `.cjs`, et les scripts sans extension dont la première ligne est `#!/usr/bin/env node` — ainsi que JSON, TOML, YAML, Markdown, HTML, XML, les Dockerfiles et le shell sont colorés ; un autre fichier ne l'est pas.
63+**Le fichier n'est pas du JavaScript.** Tout ce qui précède fonctionne sauf F12, qui a besoin d'un serveur de langage. La coloration dépend du langage : JavaScript — les fichiers `.js`, `.mjs` et `.cjs`, et les scripts sans extension dont la première ligne est `#!/usr/bin/env node` — ainsi que JSON, TOML, YAML, Markdown, AsciiDoc, HTML, XML, les Dockerfiles et le shell sont colorés ; un autre fichier ne l'est pas.
6464
6565 **Vous voulez savoir où vous êtes.** L'extrémité droite de la barre d'état affiche en permanence `ligne:colonne`, à partir de un.
6666
@@ -60,7 +60,7 @@ Si les fenêtres se recouvrent, `Window ▸ Tile` les dispose côte à côte et
60 60
61 ## Variantes61 ## Variantes
62 62
63-**Le fichier n'est pas du JavaScript.** Tout ce qui précède fonctionne sauf F12, qui a besoin d'un serveur de langage. La coloration dépend du langage : JavaScript — les fichiers `.js`, `.mjs` et `.cjs`, et les scripts sans extension dont la première ligne est `#!/usr/bin/env node` — ainsi que JSON, TOML, YAML, Markdown, HTML, XML, les Dockerfiles et le shell sont colorés ; un autre fichier ne l'est pas.63+**Le fichier n'est pas du JavaScript.** Tout ce qui précède fonctionne sauf F12, qui a besoin d'un serveur de langage. La coloration dépend du langage : JavaScript — les fichiers `.js`, `.mjs` et `.cjs`, et les scripts sans extension dont la première ligne est `#!/usr/bin/env node` — ainsi que JSON, TOML, YAML, Markdown, AsciiDoc, HTML, XML, les Dockerfiles et le shell sont colorés ; un autre fichier ne l'est pas.
64 64
65 **Vous voulez savoir où vous êtes.** L'extrémité droite de la barre d'état affiche en permanence `ligne:colonne`, à partir de un.65 **Vous voulez savoir où vous êtes.** L'extrémité droite de la barre d'état affiche en permanence `ligne:colonne`, à partir de un.
66 66
modified docs/fr/how-to/use-a-terminal.md +15 -0
@@ -31,6 +31,21 @@ Ce que l'éditeur conserve est court, et voulu — c'est le chemin de sortie :
3131
3232 Taper quoi que ce soit ramène directement à l'écran vivant : jamais besoin de redescendre avant de lancer la commande suivante.
3333
34+## Copier depuis le terminal vers un fichier, et retour
35+
36+Le shell garde `Ctrl-C` et `Ctrl-V` ; le terminal utilise donc l'autre orthographe du copier-coller de l'éditeur, celle qu'affiche le menu Édition.
37+
38+**Hors du terminal.** Sélectionnez ce que vous voulez, puis appuyez sur `Ctrl-Inser` (ou choisissez **Édition ▸ Copier**) :
39+
40+- **À la souris**, faites glisser sur le texte. Un glissement qui dépasse le bord de la fenêtre continue de sélectionner jusqu'à ce bord.
41+- **Au clavier**, `Maj-↑` et `Maj-↓` sélectionnent des lignes entières, à partir de la ligne où se trouve le curseur du shell, une ligne à la fois.
42+
43+La sélection est surlignée, et la barre d'état dit combien de lignes ont été copiées. Le texte va dans le presse-papiers de l'éditeur et, si votre terminal le permet, dans celui du système aussi. Passez dans un fichier et appuyez sur `Maj-Inser` pour le coller. Une fenêtre dont la commande est terminée peut encore être sélectionnée et copiée.
44+
45+**Dans le terminal.** Copiez quelque chose dans un fichier — `Ctrl-Inser`, ou `Ctrl-C` là-bas —, passez le terminal au premier plan et appuyez sur `Maj-Inser` (ou **Édition ▸ Coller**). Le texte est tapé dans le shell avec une Entrée par fin de ligne, donc un collage multiligne s'exécute ligne par ligne — sauf si le shell a demandé le collage entre crochets, comme le font `bash`, `zsh` et `fish` : il reçoit alors le bloc entier à éditer avant de l'exécuter. Un collage venu de l'extérieur de l'éditeur dans une fenêtre terminal est transmis de la même façon.
46+
47+Un simple clic abandonne la sélection. `Ctrl-Inser` sans sélection ne fait rien, et n'atteint jamais le shell.
48+
3449 ## Travailler avec le fichier et le shell côte à côte
3550
3651 Un terminal est une fenêtre ordinaire, donc toutes les commandes de fenêtre s'y appliquent :
@@ -31,6 +31,21 @@ Ce que l'éditeur conserve est court, et voulu — c'est le chemin de sortie :
31 31
32 Taper quoi que ce soit ramène directement à l'écran vivant : jamais besoin de redescendre avant de lancer la commande suivante.32 Taper quoi que ce soit ramène directement à l'écran vivant : jamais besoin de redescendre avant de lancer la commande suivante.
33 33
34+## Copier depuis le terminal vers un fichier, et retour
35+
36+Le shell garde `Ctrl-C` et `Ctrl-V` ; le terminal utilise donc l'autre orthographe du copier-coller de l'éditeur, celle qu'affiche le menu Édition.
37+
38+**Hors du terminal.** Sélectionnez ce que vous voulez, puis appuyez sur `Ctrl-Inser` (ou choisissez **Édition ▸ Copier**) :
39+
40+- **À la souris**, faites glisser sur le texte. Un glissement qui dépasse le bord de la fenêtre continue de sélectionner jusqu'à ce bord.
41+- **Au clavier**, `Maj-↑` et `Maj-↓` sélectionnent des lignes entières, à partir de la ligne où se trouve le curseur du shell, une ligne à la fois.
42+
43+La sélection est surlignée, et la barre d'état dit combien de lignes ont été copiées. Le texte va dans le presse-papiers de l'éditeur et, si votre terminal le permet, dans celui du système aussi. Passez dans un fichier et appuyez sur `Maj-Inser` pour le coller. Une fenêtre dont la commande est terminée peut encore être sélectionnée et copiée.
44+
45+**Dans le terminal.** Copiez quelque chose dans un fichier — `Ctrl-Inser`, ou `Ctrl-C` là-bas —, passez le terminal au premier plan et appuyez sur `Maj-Inser` (ou **Édition ▸ Coller**). Le texte est tapé dans le shell avec une Entrée par fin de ligne, donc un collage multiligne s'exécute ligne par ligne — sauf si le shell a demandé le collage entre crochets, comme le font `bash`, `zsh` et `fish` : il reçoit alors le bloc entier à éditer avant de l'exécuter. Un collage venu de l'extérieur de l'éditeur dans une fenêtre terminal est transmis de la même façon.
46+
47+Un simple clic abandonne la sélection. `Ctrl-Inser` sans sélection ne fait rien, et n'atteint jamais le shell.
48+
34 ## Travailler avec le fichier et le shell côte à côte49 ## Travailler avec le fichier et le shell côte à côte
35 50
36 Un terminal est une fenêtre ordinaire, donc toutes les commandes de fenêtre s'y appliquent :51 Un terminal est une fenêtre ordinaire, donc toutes les commandes de fenêtre s'y appliquent :
modified docs/fr/reference/keyboard.md +4 -0
@@ -144,6 +144,9 @@ Une fenêtre terminal au premier plan reçoit **toutes les touches sauf** les to
144144 | Touche | Action |
145145 | --- | --- |
146146 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |
147+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières, depuis la ligne du curseur du shell |
148+| `Ctrl-Inser` | Copier la sélection (aussi **Édition ▸ Copier**) |
149+| `Maj-Inser` | Coller le presse-papiers de l'éditeur dans le shell (aussi **Édition ▸ Coller**) |
147150 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |
148151
149152 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).
@@ -176,4 +179,5 @@ Traitées quand la fenêtre de l'arbre a le focus. Les règles complètes sont d
176179 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |
177180 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |
178181 | Molette sur un terminal | Défiler de trois lignes dans son historique |
182+| Glisser sur un terminal | Sélectionner du texte ; un clic abandonne la sélection |
179183 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |
@@ -144,6 +144,9 @@ Une fenêtre terminal au premier plan reçoit **toutes les touches sauf** les to
144 | Touche | Action |144 | Touche | Action |
145 | --- | --- |145 | --- | --- |
146 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |146 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |
147+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières, depuis la ligne du curseur du shell |
148+| `Ctrl-Inser` | Copier la sélection (aussi **Édition ▸ Copier**) |
149+| `Maj-Inser` | Coller le presse-papiers de l'éditeur dans le shell (aussi **Édition ▸ Coller**) |
147 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |150 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |
148 151
149 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).152 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).
@@ -176,4 +179,5 @@ Traitées quand la fenêtre de l'arbre a le focus. Les règles complètes sont d
176 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |179 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |
177 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |180 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |
178 | Molette sur un terminal | Défiler de trois lignes dans son historique |181 | Molette sur un terminal | Défiler de trois lignes dans son historique |
182+| Glisser sur un terminal | Sélectionner du texte ; un clic abandonne la sélection |
179 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |183 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |
modified docs/fr/reference/languages.md +32 -9
@@ -13,6 +13,7 @@ L'**extension** d'un fichier décide dès qu'elle est l'une de celles-ci :
1313 | `.toml` | TOML |
1414 | `.yaml`, `.yml` | YAML |
1515 | `.md`, `.markdown` | Markdown |
16+| `.adoc`, `.asciidoc` | AsciiDoc |
1617 | `.html`, `.htm` | HTML |
1718 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
1819 | `.sh`, `.bash`, `.zsh` | Shell |
@@ -51,22 +52,22 @@ Chaque scanner produit le même vocabulaire de classes, et chacune correspond à
5152 | Classe | Clé de thème | Produite par |
5253 | --- | --- | --- |
5354 | `identifier` | `syntax.identifier` | JavaScript, JSON (un mot nu, qui n'est pas du JSON), TOML, shell, YAML, Dockerfile |
54-| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile |
55+| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
5556 | `type` | `syntax.type` | JavaScript (noms de classes et noms capitalisés), TOML (en-têtes de table), YAML (tags) |
5657 | `builtin` | `syntax.builtin` | JavaScript (les globales de la bibliothèque standard et de Node), shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |
57-| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML et XML (entités) |
58+| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML et XML (entités), AsciiDoc |
5859 | `function` | `syntax.function` | JavaScript, shell (la commande) |
59-| `string` | `syntax.string` | tous |
60+| `string` | `syntax.string` | tous, AsciiDoc |
6061 | `char` | `syntax.char` | JavaScript (littéraux d'expressions régulières) |
6162 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |
62-| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile |
63+| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
6364 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (en-têtes de scalaires bloc), XML, Dockerfile |
64-| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile |
65-| `heading` | `syntax.heading` | Markdown |
65+| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile, AsciiDoc |
66+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
6667 | `tag` | `syntax.tag` | HTML, XML |
67-| `attribute` | `syntax.attribute` | JSON (clés), JavaScript (décorateurs), HTML, XML, Dockerfile (options) |
68-| `emphasis` | `syntax.emphasis` | Markdown |
69-| `link` | `syntax.link` | Markdown |
68+| `attribute` | `syntax.attribute` | JSON (clés), JavaScript (décorateurs), HTML, XML, Dockerfile (options), AsciiDoc |
69+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
70+| `link` | `syntax.link` | Markdown, AsciiDoc |
7071
7172 JavaScript ne produit aucune portée `heading`, `tag`, `emphasis` ou `link`. Dans `turbo-classic`, `syntax.number` et `syntax.constant` sont tous deux magenta et `syntax.char` a le vert de `syntax.string`, si bien que `42` et `true` partagent une couleur là, et `/re/` et `"re"` aussi ; d'autres thèmes les séparent. Voir [écrire son propre thème](../how-to/write-a-theme.md) pour changer cela.
7273
@@ -206,6 +207,28 @@ Un bloc clôturé est **d'une seule couleur quel que soit le langage annoncé**
206207
207208 La suite de marqueurs ouvrant une emphase doit être fermée par une suite de même longueur, `**gras**` est donc une portée plutôt que deux italiques.
208209
210+## AsciiDoc
211+
212+| Reconnu | Comme |
213+| --- | --- |
214+| `= Titre` … `====== Titre`, et `# Titre` … `###### Titre` | toute la ligne en heading |
215+| `*gras*`, `**gras**`, `_italique_`, `__italique__` | emphasis |
216+| `` `mono` `` | string |
217+| `https://…`, `link:…[texte]`, `xref:…[texte]`, `mailto:…[]`, `image:…[]`, `<<ancre>>`, `<<ancre,texte>>` | l'ensemble en link |
218+| `image::…[]`, `include::…[]`, `toc::[]` seuls sur leur ligne | toute la ligne en link |
219+| `{attribut}` | constant |
220+| `:nom: valeur`, `:nom!:` | le `:nom:` en attribute ; la valeur en prose |
221+| `[source,go]`, `[NOTE]`, `[[ancre]]` seuls sur leur ligne | toute la ligne en attribute |
222+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | l'étiquette en keyword |
223+| `.Titre de bloc` | emphasis |
224+| `* `, `** `, `- `, `. `, `.. `, `1. ` | le marqueur en punctuation |
225+| `====`, `****`, `____`, `--`, `|===` | punctuation ; les lignes entre eux sont de la prose |
226+| `|` dans une ligne de tableau | punctuation ; les cellules sont de la prose |
227+| blocs `----`, `....`, `++++` | tout le bloc, délimiteurs compris, en string |
228+| blocs `////` et lignes `//` | comment |
229+
230+Un bloc verbatim est **d'une seule couleur quoi que dise son `[source]`**, et ne se ferme que sur un délimiteur de **même longueur** — la règle d'AsciiDoc, et ce qui permet à un listing de contenir une ligne de tirets. Un bloc non fermé colore jusqu'à la fin du fichier. Gras, italique et monospace suivent les règles Markdown ci-dessus, suites de marqueurs appariées par longueur. Non reconnus : les paragraphes littéraux (lignes indentées), les listes de description (`terme:: texte`), `+passthrough+`, `#surlignage#` — et les fichiers `.asc`, aussi souvent des signatures PGP que des documents.
231+
209232 ## HTML
210233
211234 | Reconnu | Comme |
@@ -13,6 +13,7 @@ L'**extension** d'un fichier décide dès qu'elle est l'une de celles-ci :
13 | `.toml` | TOML |13 | `.toml` | TOML |
14 | `.yaml`, `.yml` | YAML |14 | `.yaml`, `.yml` | YAML |
15 | `.md`, `.markdown` | Markdown |15 | `.md`, `.markdown` | Markdown |
16+| `.adoc`, `.asciidoc` | AsciiDoc |
16 | `.html`, `.htm` | HTML |17 | `.html`, `.htm` | HTML |
17 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |18 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
18 | `.sh`, `.bash`, `.zsh` | Shell |19 | `.sh`, `.bash`, `.zsh` | Shell |
@@ -51,22 +52,22 @@ Chaque scanner produit le même vocabulaire de classes, et chacune correspond à
51 | Classe | Clé de thème | Produite par |52 | Classe | Clé de thème | Produite par |
52 | --- | --- | --- |53 | --- | --- | --- |
53 | `identifier` | `syntax.identifier` | JavaScript, JSON (un mot nu, qui n'est pas du JSON), TOML, shell, YAML, Dockerfile |54 | `identifier` | `syntax.identifier` | JavaScript, JSON (un mot nu, qui n'est pas du JSON), TOML, shell, YAML, Dockerfile |
54-| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile |55+| `keyword` | `syntax.keyword` | JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
55 | `type` | `syntax.type` | JavaScript (noms de classes et noms capitalisés), TOML (en-têtes de table), YAML (tags) |56 | `type` | `syntax.type` | JavaScript (noms de classes et noms capitalisés), TOML (en-têtes de table), YAML (tags) |
56 | `builtin` | `syntax.builtin` | JavaScript (les globales de la bibliothèque standard et de Node), shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |57 | `builtin` | `syntax.builtin` | JavaScript (les globales de la bibliothèque standard et de Node), shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |
57-| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML et XML (entités) |58+| `constant` | `syntax.constant` | JavaScript, JSON, TOML, shell, YAML, HTML et XML (entités), AsciiDoc |
58 | `function` | `syntax.function` | JavaScript, shell (la commande) |59 | `function` | `syntax.function` | JavaScript, shell (la commande) |
59-| `string` | `syntax.string` | tous |60+| `string` | `syntax.string` | tous, AsciiDoc |
60 | `char` | `syntax.char` | JavaScript (littéraux d'expressions régulières) |61 | `char` | `syntax.char` | JavaScript (littéraux d'expressions régulières) |
61 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |62 | `number` | `syntax.number` | JavaScript, JSON, TOML, shell, YAML, Dockerfile |
62-| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile |63+| `comment` | `syntax.comment` | JavaScript, JSON, TOML, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
63 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (en-têtes de scalaires bloc), XML, Dockerfile |64 | `operator` | `syntax.operator` | JavaScript, TOML, shell, HTML, YAML (en-têtes de scalaires bloc), XML, Dockerfile |
64-| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile |65+| `punctuation` | `syntax.punctuation` | JavaScript, JSON, TOML, shell, Markdown, YAML, Dockerfile, AsciiDoc |
65-| `heading` | `syntax.heading` | Markdown |66+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
66 | `tag` | `syntax.tag` | HTML, XML |67 | `tag` | `syntax.tag` | HTML, XML |
67-| `attribute` | `syntax.attribute` | JSON (clés), JavaScript (décorateurs), HTML, XML, Dockerfile (options) |68+| `attribute` | `syntax.attribute` | JSON (clés), JavaScript (décorateurs), HTML, XML, Dockerfile (options), AsciiDoc |
68-| `emphasis` | `syntax.emphasis` | Markdown |69+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
69-| `link` | `syntax.link` | Markdown |70+| `link` | `syntax.link` | Markdown, AsciiDoc |
70 71
71 JavaScript ne produit aucune portée `heading`, `tag`, `emphasis` ou `link`. Dans `turbo-classic`, `syntax.number` et `syntax.constant` sont tous deux magenta et `syntax.char` a le vert de `syntax.string`, si bien que `42` et `true` partagent une couleur là, et `/re/` et `"re"` aussi ; d'autres thèmes les séparent. Voir [écrire son propre thème](../how-to/write-a-theme.md) pour changer cela.72 JavaScript ne produit aucune portée `heading`, `tag`, `emphasis` ou `link`. Dans `turbo-classic`, `syntax.number` et `syntax.constant` sont tous deux magenta et `syntax.char` a le vert de `syntax.string`, si bien que `42` et `true` partagent une couleur là, et `/re/` et `"re"` aussi ; d'autres thèmes les séparent. Voir [écrire son propre thème](../how-to/write-a-theme.md) pour changer cela.
72 73
@@ -206,6 +207,28 @@ Un bloc clôturé est **d'une seule couleur quel que soit le langage annoncé**
206 207
207 La suite de marqueurs ouvrant une emphase doit être fermée par une suite de même longueur, `**gras**` est donc une portée plutôt que deux italiques.208 La suite de marqueurs ouvrant une emphase doit être fermée par une suite de même longueur, `**gras**` est donc une portée plutôt que deux italiques.
208 209
210+## AsciiDoc
211+
212+| Reconnu | Comme |
213+| --- | --- |
214+| `= Titre` … `====== Titre`, et `# Titre` … `###### Titre` | toute la ligne en heading |
215+| `*gras*`, `**gras**`, `_italique_`, `__italique__` | emphasis |
216+| `` `mono` `` | string |
217+| `https://…`, `link:…[texte]`, `xref:…[texte]`, `mailto:…[]`, `image:…[]`, `<<ancre>>`, `<<ancre,texte>>` | l'ensemble en link |
218+| `image::…[]`, `include::…[]`, `toc::[]` seuls sur leur ligne | toute la ligne en link |
219+| `{attribut}` | constant |
220+| `:nom: valeur`, `:nom!:` | le `:nom:` en attribute ; la valeur en prose |
221+| `[source,go]`, `[NOTE]`, `[[ancre]]` seuls sur leur ligne | toute la ligne en attribute |
222+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | l'étiquette en keyword |
223+| `.Titre de bloc` | emphasis |
224+| `* `, `** `, `- `, `. `, `.. `, `1. ` | le marqueur en punctuation |
225+| `====`, `****`, `____`, `--`, `|===` | punctuation ; les lignes entre eux sont de la prose |
226+| `|` dans une ligne de tableau | punctuation ; les cellules sont de la prose |
227+| blocs `----`, `....`, `++++` | tout le bloc, délimiteurs compris, en string |
228+| blocs `////` et lignes `//` | comment |
229+
230+Un bloc verbatim est **d'une seule couleur quoi que dise son `[source]`**, et ne se ferme que sur un délimiteur de **même longueur** — la règle d'AsciiDoc, et ce qui permet à un listing de contenir une ligne de tirets. Un bloc non fermé colore jusqu'à la fin du fichier. Gras, italique et monospace suivent les règles Markdown ci-dessus, suites de marqueurs appariées par longueur. Non reconnus : les paragraphes littéraux (lignes indentées), les listes de description (`terme:: texte`), `+passthrough+`, `#surlignage#` — et les fichiers `.asc`, aussi souvent des signatures PGP que des documents.
231+
209 ## HTML232 ## HTML
210 233
211 | Reconnu | Comme |234 | Reconnu | Comme |
modified docs/fr/reference/terminal.md +25 -4
@@ -35,7 +35,7 @@ Aucun des deux n'exige qu'un fichier soit ouvert. Les outils du menu **JavaScrip
3535
3636 ### Après la fin du programme
3737
38-Une fenêtre dont la commande est terminée garde sa sortie mais cesse de se comporter comme un terminal : seules `Maj-Page↑` et `Maj-Page↓` sont encore prises, et toute autre touche atteint l'éditeur — c'est ce qui permet à `Ctrl-W` de la fermer.
38+Une fenêtre dont la commande est terminée garde sa sortie mais cesse de se comporter comme un terminal : seules les touches d'historique et de sélection — `Maj-Page↑`, `Maj-Page↓`, `Maj-↑`, `Maj-↓`, `Ctrl-Inser` et `Maj-Inser` — sont encore prises, de sorte que ce qu'elle a affiché peut encore être sélectionné et copié (rien ne peut y être collé), et toute autre touche atteint l'éditeur — c'est ce qui permet à `Ctrl-W` de la fermer.
3939
4040 ### Envoyées au shell
4141
@@ -76,18 +76,37 @@ Les touches de fonction n'atteignent donc jamais un programme lancé dans une fe
7676 | --- | --- |
7777 | `Shift-PgUp` | Reculer d'un écran dans l'historique |
7878 | `Shift-PgDn` | Avancer d'un écran |
79+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières : depuis la ligne du curseur du shell sans sélection, sinon une ligne de plus vers le haut ou le bas. Une sélection à la souris devient des lignes entières |
80+| `Ctrl-Inser` | Copier la sélection dans le presse-papiers de l'éditeur et celui du système, puis l'abandonner. Prise même sans sélection, pour ne jamais atteindre le shell en `Insert` |
81+| `Maj-Inser` | Taper le presse-papiers de l'éditeur dans le shell (voir [Copier et coller](#copier-et-coller)). Prise même si le presse-papiers est vide |
7982
80-Toute touche envoyée au shell ramène également la vue à l'écran vivant.
83+Toute touche envoyée au shell ramène également la vue à l'écran vivant. `Maj-↑` et `Maj-↓` n'atteignent donc jamais un programme : celui qui les voudrait n'obtient rien.
8184
8285 ## Souris
8386
8487 | Action | Effet |
8588 | --- | --- |
8689 | Molette haut / bas | Défiler de trois lignes dans l'historique |
87-| Clic | Passe la fenêtre au premier plan ; n'est pas transmis au programme |
90+| Clic | Passe la fenêtre au premier plan et abandonne toute sélection ; n'est pas transmis au programme |
91+| Glisser avec le bouton gauche | Sélectionne le texte entre le point d'appui et le pointeur, caractère par caractère d'une ligne à l'autre. Glisser au-delà du bord de la fenêtre sélectionne jusqu'à ce bord |
8892
8993 Le rapport souris n'est pas implémenté : un programme n'est jamais informé des clics.
9094
95+## Copier et coller
96+
97+| Propriété | Valeur |
98+| --- | --- |
99+| Sélection | Deux cellules du texte entier — historique et écran vivant réunis —, de sorte qu'elle reste sur le même texte pendant que le shell écrit en dessous |
100+| Surlignage | La clé `editor.selection` du thème, qui remplace les couleurs du programme dans la sélection |
101+| Texte copié | Les cellules sélectionnées, lignes jointes par `\n`. Une ligne sélectionnée jusqu'à son bord droit perd ses blancs de fin ; une ligne sélectionnée avant le bord garde chaque blanc choisi |
102+| Destination de la copie | Le presse-papiers de l'éditeur, et celui du système via OSC 52 (non vérifié : le terminal peut le refuser) |
103+| Barre d'état | `Copied N lines` |
104+| Texte collé | Chaque `\n` ou `\r\n` devient `\r`, comme l'envoie `Entrée`. Avec le mode privé 2004 actif, le tout est encadré par `ESC [ 200 ~` … `ESC [ 201 ~` |
105+| Sources d'un collage | `Maj-Inser` et **Édition ▸ Coller** (le presse-papiers de l'éditeur) ; un collage entre crochets venu du terminal qui héberge l'éditeur, transmis entier |
106+| Sélection abandonnée par | Une copie, un collage, un clic, un nouveau glissement |
107+| Sélection conservée malgré | L'arrivée de sortie, le défilement, les touches envoyées au shell |
108+| Non sélectionnable | Rien : l'écran alternatif et une fenêtre terminée peuvent tous deux être sélectionnés |
109+
91110 ## Historique
92111
93112 | Propriété | Valeur |
@@ -157,6 +176,7 @@ Activés par `CSI ? n h`, désactivés par `CSI ? n l`.
157176 | 47, 1047 | | Écran alternatif |
158177 | 1048 | | Sauvegarder / restaurer le curseur |
159178 | 1049 | | Sauvegarder le curseur, puis l'écran alternatif |
179+| 2004 | | Collage entre crochets : un collage dans la fenêtre est encadré par `ESC [ 200 ~` … `ESC [ 201 ~` |
160180
161181 Tout autre mode est analysé et ignoré.
162182
@@ -202,7 +222,7 @@ Analysées correctement, donc jamais affichées comme des caractères parasites,
202222
203223 ### Non implémenté
204224
205-Le rapport souris, le collage entre crochets, les bascules shift-in / shift-out, les lignes double largeur, sixel et les autres protocoles graphiques, ainsi que les rapports d'état et d'attributs DEC. Un programme qui en demande un n'obtient aucune réponse : celui qui en attend une attendra indéfiniment.
225+Le rapport souris, les bascules shift-in / shift-out, les lignes double largeur, sixel et les autres protocoles graphiques, ainsi que les rapports d'état et d'attributs DEC. Un programme qui en demande un n'obtient aucune réponse : celui qui en attend une attendra indéfiniment.
206226
207227 ## Couleurs
208228
@@ -210,6 +230,7 @@ Le rapport souris, le collage entre crochets, les bascules shift-in / shift-out,
210230 | --- | --- |
211231 | `terminal.text` | Toute cellule dont le programme n'a pas choisi la couleur |
212232 | `terminal.cursor` | La cellule sous le curseur, quand la fenêtre a le focus |
233+| `editor.selection` | Les cellules sélectionnées — la même couleur qu'une sélection dans un fichier |
213234
214235 Voir [Format des fichiers de thème](themes.md).
215236
@@ -35,7 +35,7 @@ Aucun des deux n'exige qu'un fichier soit ouvert. Les outils du menu **JavaScrip
35 35
36 ### Après la fin du programme36 ### Après la fin du programme
37 37
38-Une fenêtre dont la commande est terminée garde sa sortie mais cesse de se comporter comme un terminal : seules `Maj-Page↑` et `Maj-Page↓` sont encore prises, et toute autre touche atteint l'éditeur — c'est ce qui permet à `Ctrl-W` de la fermer.38+Une fenêtre dont la commande est terminée garde sa sortie mais cesse de se comporter comme un terminal : seules les touches d'historique et de sélection — `Maj-Page↑`, `Maj-Page↓`, `Maj-↑`, `Maj-↓`, `Ctrl-Inser` et `Maj-Inser` — sont encore prises, de sorte que ce qu'elle a affiché peut encore être sélectionné et copié (rien ne peut y être collé), et toute autre touche atteint l'éditeur — c'est ce qui permet à `Ctrl-W` de la fermer.
39 39
40 ### Envoyées au shell40 ### Envoyées au shell
41 41
@@ -76,18 +76,37 @@ Les touches de fonction n'atteignent donc jamais un programme lancé dans une fe
76 | --- | --- |76 | --- | --- |
77 | `Shift-PgUp` | Reculer d'un écran dans l'historique |77 | `Shift-PgUp` | Reculer d'un écran dans l'historique |
78 | `Shift-PgDn` | Avancer d'un écran |78 | `Shift-PgDn` | Avancer d'un écran |
79+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières : depuis la ligne du curseur du shell sans sélection, sinon une ligne de plus vers le haut ou le bas. Une sélection à la souris devient des lignes entières |
80+| `Ctrl-Inser` | Copier la sélection dans le presse-papiers de l'éditeur et celui du système, puis l'abandonner. Prise même sans sélection, pour ne jamais atteindre le shell en `Insert` |
81+| `Maj-Inser` | Taper le presse-papiers de l'éditeur dans le shell (voir [Copier et coller](#copier-et-coller)). Prise même si le presse-papiers est vide |
79 82
80-Toute touche envoyée au shell ramène également la vue à l'écran vivant.83+Toute touche envoyée au shell ramène également la vue à l'écran vivant. `Maj-↑` et `Maj-↓` n'atteignent donc jamais un programme : celui qui les voudrait n'obtient rien.
81 84
82 ## Souris85 ## Souris
83 86
84 | Action | Effet |87 | Action | Effet |
85 | --- | --- |88 | --- | --- |
86 | Molette haut / bas | Défiler de trois lignes dans l'historique |89 | Molette haut / bas | Défiler de trois lignes dans l'historique |
87-| Clic | Passe la fenêtre au premier plan ; n'est pas transmis au programme |90+| Clic | Passe la fenêtre au premier plan et abandonne toute sélection ; n'est pas transmis au programme |
91+| Glisser avec le bouton gauche | Sélectionne le texte entre le point d'appui et le pointeur, caractère par caractère d'une ligne à l'autre. Glisser au-delà du bord de la fenêtre sélectionne jusqu'à ce bord |
88 92
89 Le rapport souris n'est pas implémenté : un programme n'est jamais informé des clics.93 Le rapport souris n'est pas implémenté : un programme n'est jamais informé des clics.
90 94
95+## Copier et coller
96+
97+| Propriété | Valeur |
98+| --- | --- |
99+| Sélection | Deux cellules du texte entier — historique et écran vivant réunis —, de sorte qu'elle reste sur le même texte pendant que le shell écrit en dessous |
100+| Surlignage | La clé `editor.selection` du thème, qui remplace les couleurs du programme dans la sélection |
101+| Texte copié | Les cellules sélectionnées, lignes jointes par `\n`. Une ligne sélectionnée jusqu'à son bord droit perd ses blancs de fin ; une ligne sélectionnée avant le bord garde chaque blanc choisi |
102+| Destination de la copie | Le presse-papiers de l'éditeur, et celui du système via OSC 52 (non vérifié : le terminal peut le refuser) |
103+| Barre d'état | `Copied N lines` |
104+| Texte collé | Chaque `\n` ou `\r\n` devient `\r`, comme l'envoie `Entrée`. Avec le mode privé 2004 actif, le tout est encadré par `ESC [ 200 ~` … `ESC [ 201 ~` |
105+| Sources d'un collage | `Maj-Inser` et **Édition ▸ Coller** (le presse-papiers de l'éditeur) ; un collage entre crochets venu du terminal qui héberge l'éditeur, transmis entier |
106+| Sélection abandonnée par | Une copie, un collage, un clic, un nouveau glissement |
107+| Sélection conservée malgré | L'arrivée de sortie, le défilement, les touches envoyées au shell |
108+| Non sélectionnable | Rien : l'écran alternatif et une fenêtre terminée peuvent tous deux être sélectionnés |
109+
91 ## Historique110 ## Historique
92 111
93 | Propriété | Valeur |112 | Propriété | Valeur |
@@ -157,6 +176,7 @@ Activés par `CSI ? n h`, désactivés par `CSI ? n l`.
157 | 47, 1047 | | Écran alternatif |176 | 47, 1047 | | Écran alternatif |
158 | 1048 | | Sauvegarder / restaurer le curseur |177 | 1048 | | Sauvegarder / restaurer le curseur |
159 | 1049 | | Sauvegarder le curseur, puis l'écran alternatif |178 | 1049 | | Sauvegarder le curseur, puis l'écran alternatif |
179+| 2004 | | Collage entre crochets : un collage dans la fenêtre est encadré par `ESC [ 200 ~` … `ESC [ 201 ~` |
160 180
161 Tout autre mode est analysé et ignoré.181 Tout autre mode est analysé et ignoré.
162 182
@@ -202,7 +222,7 @@ Analysées correctement, donc jamais affichées comme des caractères parasites,
202 222
203 ### Non implémenté223 ### Non implémenté
204 224
205-Le rapport souris, le collage entre crochets, les bascules shift-in / shift-out, les lignes double largeur, sixel et les autres protocoles graphiques, ainsi que les rapports d'état et d'attributs DEC. Un programme qui en demande un n'obtient aucune réponse : celui qui en attend une attendra indéfiniment.225+Le rapport souris, les bascules shift-in / shift-out, les lignes double largeur, sixel et les autres protocoles graphiques, ainsi que les rapports d'état et d'attributs DEC. Un programme qui en demande un n'obtient aucune réponse : celui qui en attend une attendra indéfiniment.
206 226
207 ## Couleurs227 ## Couleurs
208 228
@@ -210,6 +230,7 @@ Le rapport souris, le collage entre crochets, les bascules shift-in / shift-out,
210 | --- | --- |230 | --- | --- |
211 | `terminal.text` | Toute cellule dont le programme n'a pas choisi la couleur |231 | `terminal.text` | Toute cellule dont le programme n'a pas choisi la couleur |
212 | `terminal.cursor` | La cellule sous le curseur, quand la fenêtre a le focus |232 | `terminal.cursor` | La cellule sous le curseur, quand la fenêtre a le focus |
233+| `editor.selection` | Les cellules sélectionnées — la même couleur qu'une sélection dans un fichier |
213 234
214 Voir [Format des fichiers de thème](themes.md).235 Voir [Format des fichiers de thème](themes.md).
215 236
modified go.mod +1 -1
@@ -4,7 +4,7 @@ go 1.26.1
44
55 require (
66 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.3
7+ rickub.com/turbo-editors/turbo-core v1.0.4
88 )
99
1010 require (
@@ -4,7 +4,7 @@ go 1.26.1
4 4
5 require (5 require (
6 github.com/gdamore/tcell/v2 v2.13.106 github.com/gdamore/tcell/v2 v2.13.10
7- rickub.com/turbo-editors/turbo-core v1.0.37+ rickub.com/turbo-editors/turbo-core v1.0.4
8 )8 )
9 9
10 require (10 require (
modified go.sum +2 -2
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
4545 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
4646 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
4747 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=
49-rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
48+rickub.com/turbo-editors/turbo-core v1.0.4 h1:oxySn9S6aEoHC1HPrarkxCnW5fTcPPXym7dMjSLRKaY=
49+rickub.com/turbo-editors/turbo-core v1.0.4/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
@@ -45,5 +45,5 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=45 golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=46 golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=47 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
48-rickub.com/turbo-editors/turbo-core v1.0.3 h1:j+bqzIIBsese8iLgre9PQdbpi9YkoOMIHP6pOli5UjE=48+rickub.com/turbo-editors/turbo-core v1.0.4 h1:oxySn9S6aEoHC1HPrarkxCnW5fTcPPXym7dMjSLRKaY=
49-rickub.com/turbo-editors/turbo-core v1.0.3/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=49+rickub.com/turbo-editors/turbo-core v1.0.4/go.mod h1:rmfIY5gsFEo3sC5IIJFapwsGvdKG6NjrD7ACmnNTKq8=
modified internal/jslang/snippets.toml.tmpl +1 -1
@@ -6,7 +6,7 @@
66 # first is indented to match the line you inserted it on.
77 #
88 # languages restricts a snippet to files of those kinds, by the names the
9-# editor uses: javascript, json, toml, yaml, markdown, html, xml, dockerfile,
9+# editor uses: javascript, json, toml, yaml, markdown, asciidoc, html, xml, dockerfile,
1010 # bash. Leave it out and the snippet is offered everywhere.
1111 #
1212 # Bodies indent with two spaces, which is what Prettier writes by default; a
@@ -6,7 +6,7 @@
6 # first is indented to match the line you inserted it on.6 # first is indented to match the line you inserted it on.
7 #7 #
8 # languages restricts a snippet to files of those kinds, by the names the8 # languages restricts a snippet to files of those kinds, by the names the
9-# editor uses: javascript, json, toml, yaml, markdown, html, xml, dockerfile,9+# editor uses: javascript, json, toml, yaml, markdown, asciidoc, html, xml, dockerfile,
10 # bash. Leave it out and the snippet is offered everywhere.10 # bash. Leave it out and the snippet is offered everywhere.
11 #11 #
12 # Bodies indent with two spaces, which is what Prettier writes by default; a12 # Bodies indent with two spaces, which is what Prettier writes by default; a
modified release.env +1 -1
@@ -6,5 +6,5 @@
66 #
77 # ./02-build-releases.sh v1.0.0 to build the binaries by hand and see what
88 # the CI will publish, without publishing anything
9-TAG="v1.0.3"
9+TAG="v1.0.4"
1010 ABOUT="Turbo JS"
@@ -6,5 +6,5 @@
6 #6 #
7 # ./02-build-releases.sh v1.0.0 to build the binaries by hand and see what7 # ./02-build-releases.sh v1.0.0 to build the binaries by hand and see what
8 # the CI will publish, without publishing anything8 # the CI will publish, without publishing anything
9-TAG="v1.0.3"9+TAG="v1.0.4"
10 ABOUT="Turbo JS"10 ABOUT="Turbo JS"