turbo-editors/turbo-gopublic Fork
⑂ 5936346
Commits
⬇ Clone ▾
git clone https://git.rickub.com/turbo-editors/turbo-go.git
git clone ssh://git@rickub.com/turbo-editors/turbo-go.git

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

Download ZIP

📦 Turbo Go

k33g committed 2026-09-22T06:54:43+02:00 Browse files
5936346 parent: 358e481
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
@@ -526,3 +526,13 @@
526526 - **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.
527527 - **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.
528528
529+## 2026-09-21 — AsciiDoc arrives in turbo-core (ticket #31): template comment and docs ahead of the re-pin
530+
531+- **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).
532+- **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).
533+- **Not done**: `go.mod` still pins v1.0.3; nothing committed.
534+
535+## 2026-09-21 — terminal copy/paste arrives in turbo-core v1.0.4: docs ahead of the re-pin
536+
537+- **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.
538+- **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.
@@ -526,3 +526,13 @@
526 - **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.526 - **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.
527 - **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.527 - **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.
528 528
529+## 2026-09-21 — AsciiDoc arrives in turbo-core (ticket #31): template comment and docs ahead of the re-pin
530+
531+- **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).
532+- **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).
533+- **Not done**: `go.mod` still pins v1.0.3; nothing committed.
534+
535+## 2026-09-21 — terminal copy/paste arrives in turbo-core v1.0.4: docs ahead of the re-pin
536+
537+- **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.
538+- **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
@@ -212,3 +212,7 @@ Reports land in `.quality/`; exit code 0 = pass.
212212
213213 - **`-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-go` already is refused, not overwritten.
214214
215+## State as of 2026-09-21
216+
217+- 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.
218+
@@ -212,3 +212,7 @@ Reports land in `.quality/`; exit code 0 = pass.
212 212
213 - **`-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-go` already is refused, not overwritten.213 - **`-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-go` already is refused, not overwritten.
214 214
215+## State as of 2026-09-21
216+
217+- 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.
218+
modified docs/en/explanation/architecture.md +2 -2
@@ -52,7 +52,7 @@ Everything that used to be a hardcoded `"turbo-go"`, `"gopls"` or `"go.mod"` som
5252
5353 ## Why the Go scanner is here and not in the library
5454
55-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.
55+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.
5656
5757 Go is not one of them. The language that *defines* an editor is registered by that editor, which is why a `.rs` file opens as plain text here and a `.go` file opens as plain text in Turbo Rust.
5858
@@ -63,7 +63,7 @@ The Go scanner is also the one that is *least* like the others. Every language i
6363 | Was | Is |
6464 | --- | --- |
6565 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |
66-| `internal/syntax` — six languages | `turbo-core/syntax` — eight, plus a registry; Go lives here |
66+| `internal/syntax` — six languages | `turbo-core/syntax` — nine, plus a registry; Go lives here |
6767 | `internal/app` with a `Name` constant | `turbo-core/app` taking a `profile.Profile` |
6868 | `internal/lsp` hardcoding gopls | `turbo-core/lsp` taking a `profile.Server` |
6969 | `moduleRoot` in `main.go` | `app.ProjectRoot(p, files)`, with `go.mod` in the profile |
@@ -52,7 +52,7 @@ Everything that used to be a hardcoded `"turbo-go"`, `"gopls"` or `"go.mod"` som
52 52
53 ## Why the Go scanner is here and not in the library53 ## Why the Go scanner is here and not in the library
54 54
55-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.55+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.
56 56
57 Go is not one of them. The language that *defines* an editor is registered by that editor, which is why a `.rs` file opens as plain text here and a `.go` file opens as plain text in Turbo Rust.57 Go is not one of them. The language that *defines* an editor is registered by that editor, which is why a `.rs` file opens as plain text here and a `.go` file opens as plain text in Turbo Rust.
58 58
@@ -63,7 +63,7 @@ The Go scanner is also the one that is *least* like the others. Every language i
63 | Was | Is |63 | Was | Is |
64 | --- | --- |64 | --- | --- |
65 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |65 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |
66-| `internal/syntax` — six languages | `turbo-core/syntax` — eight, plus a registry; Go lives here |66+| `internal/syntax` — six languages | `turbo-core/syntax` — nine, plus a registry; Go lives here |
67 | `internal/app` with a `Name` constant | `turbo-core/app` taking a `profile.Profile` |67 | `internal/app` with a `Name` constant | `turbo-core/app` taking a `profile.Profile` |
68 | `internal/lsp` hardcoding gopls | `turbo-core/lsp` taking a `profile.Server` |68 | `internal/lsp` hardcoding gopls | `turbo-core/lsp` taking a `profile.Server` |
69 | `moduleRoot` in `main.go` | `app.ProjectRoot(p, files)`, with `go.mod` in the profile |69 | `moduleRoot` in `main.go` | `app.ProjectRoot(p, files)`, with `go.mod` in the profile |
modified docs/en/explanation/colouring-and-completion.md +3 -3
@@ -34,11 +34,11 @@ Scanning the whole file on every keystroke sounds wasteful, and would be. It doe
3434
3535 **A language is coloured only if someone wrote a scanner for it.** There is no definition language to write a definition in, so each one is Go code.
3636
37-Eight of them — TOML, YAML, Markdown, JavaScript, HTML, XML, Dockerfiles and shell — live in turbo-core, because every editor built on it meets them whatever language it is for. The Go scanner lives here, in `internal/golang`, and is registered at start-up with `syntax.Register`. That is why a `.rs` file opens as plain text in Turbo Go: this editor registers Go and nothing else.
37+Nine of them — TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, Dockerfiles and shell — live in turbo-core, because every editor built on it meets them whatever language it is for. The Go scanner lives here, in `internal/golang`, and is registered at start-up with `syntax.Register`. That is why a `.rs` file opens as plain text in Turbo Go: this editor registers Go and nothing else.
3838
3939 That is a real limitation, and it was accepted deliberately: this is an editor for Go. A generic highlighter would have brought a dependency, a definition format, and a permanent gap between "what the highlighter thinks Go is" and what Go is.
4040
41-### The other eight languages
41+### The other nine languages
4242
4343 TOML came first, and it earned its scanner by being unavoidable: the editor reads two TOML files — theme files and a project's `.turbo-go/settings.toml` — and both are meant to be edited in the editor itself. Shipping a settings file full of explanatory comments and then showing it in flat grey would have been an odd thing to do.
4444
@@ -57,7 +57,7 @@ The unifying rule is that a scanner **guesses nothing**. Where a construct canno
5757
5858 ### Five classes that Go has nothing to say about
5959
60-The twelve classes the Go tokeniser produces cover the eight other languages almost entirely — a string is a string in all of them. Five things had no home: a Markdown heading, its emphasis and its links, and an HTML tag and attribute.
60+The twelve classes the Go tokeniser produces cover the nine other languages almost entirely — a string is a string in all of them. Five things had no home: a Markdown heading, its emphasis and its links, and an HTML tag and attribute.
6161
6262 Reusing existing classes was the cheaper option and was taken for TOML, where a table header genuinely reads as a type and a key as an identifier. It does not survive the markup languages: a heading is not a keyword and a tag is not one either, and a theme that wanted headings quiet and keywords loud could not say so. So `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` and `syntax.link` exist.
6363
@@ -34,11 +34,11 @@ Scanning the whole file on every keystroke sounds wasteful, and would be. It doe
34 34
35 **A language is coloured only if someone wrote a scanner for it.** There is no definition language to write a definition in, so each one is Go code.35 **A language is coloured only if someone wrote a scanner for it.** There is no definition language to write a definition in, so each one is Go code.
36 36
37-Eight of them — TOML, YAML, Markdown, JavaScript, HTML, XML, Dockerfiles and shell — live in turbo-core, because every editor built on it meets them whatever language it is for. The Go scanner lives here, in `internal/golang`, and is registered at start-up with `syntax.Register`. That is why a `.rs` file opens as plain text in Turbo Go: this editor registers Go and nothing else.37+Nine of them — TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, Dockerfiles and shell — live in turbo-core, because every editor built on it meets them whatever language it is for. The Go scanner lives here, in `internal/golang`, and is registered at start-up with `syntax.Register`. That is why a `.rs` file opens as plain text in Turbo Go: this editor registers Go and nothing else.
38 38
39 That is a real limitation, and it was accepted deliberately: this is an editor for Go. A generic highlighter would have brought a dependency, a definition format, and a permanent gap between "what the highlighter thinks Go is" and what Go is.39 That is a real limitation, and it was accepted deliberately: this is an editor for Go. A generic highlighter would have brought a dependency, a definition format, and a permanent gap between "what the highlighter thinks Go is" and what Go is.
40 40
41-### The other eight languages41+### The other nine languages
42 42
43 TOML came first, and it earned its scanner by being unavoidable: the editor reads two TOML files — theme files and a project's `.turbo-go/settings.toml` — and both are meant to be edited in the editor itself. Shipping a settings file full of explanatory comments and then showing it in flat grey would have been an odd thing to do.43 TOML came first, and it earned its scanner by being unavoidable: the editor reads two TOML files — theme files and a project's `.turbo-go/settings.toml` — and both are meant to be edited in the editor itself. Shipping a settings file full of explanatory comments and then showing it in flat grey would have been an odd thing to do.
44 44
@@ -57,7 +57,7 @@ The unifying rule is that a scanner **guesses nothing**. Where a construct canno
57 57
58 ### Five classes that Go has nothing to say about58 ### Five classes that Go has nothing to say about
59 59
60-The twelve classes the Go tokeniser produces cover the eight other languages almost entirely — a string is a string in all of them. Five things had no home: a Markdown heading, its emphasis and its links, and an HTML tag and attribute.60+The twelve classes the Go tokeniser produces cover the nine other languages almost entirely — a string is a string in all of them. Five things had no home: a Markdown heading, its emphasis and its links, and an HTML tag and attribute.
61 61
62 Reusing existing classes was the cheaper option and was taken for TOML, where a table header genuinely reads as a type and a key as an identifier. It does not survive the markup languages: a heading is not a keyword and a tag is not one either, and a theme that wanted headings quiet and keywords loud could not say so. So `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` and `syntax.link` exist.62 Reusing existing classes was the cheaper option and was taken for TOML, where a table header genuinely reads as a type and a key as an identifier. It does not survive the markup languages: a heading is not a keyword and a tag is not one either, and a theme that wanted headings quiet and keywords loud could not say so. So `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` and `syntax.link` exist.
63 63
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/use-a-terminal.md +15 -0
@@ -31,6 +31,21 @@ What the editor keeps is short, and deliberate — it is the way back out:
3131
3232 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.
3333
34+## Copy from the terminal into a file, and back
35+
36+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.
37+
38+**Out of the terminal.** Select what you want, then press `Ctrl-Ins` (or choose **Edit ▸ Copy**):
39+
40+- **With the mouse**, drag over the text. A drag that runs past the window's edge keeps selecting up to it.
41+- **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.
42+
43+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.
44+
45+**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.
46+
47+A plain click drops a selection. Ctrl-Ins with nothing selected does nothing, and never reaches the shell.
48+
3449 ## Work with the file and the shell side by side
3550
3651 A terminal is an ordinary window, so the window commands all apply to it:
@@ -31,6 +31,21 @@ What the editor keeps is short, and deliberate — it is the way back out:
31 31
32 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.32 Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.
33 33
34+## Copy from the terminal into a file, and back
35+
36+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.
37+
38+**Out of the terminal.** Select what you want, then press `Ctrl-Ins` (or choose **Edit ▸ Copy**):
39+
40+- **With the mouse**, drag over the text. A drag that runs past the window's edge keeps selecting up to it.
41+- **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.
42+
43+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.
44+
45+**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.
46+
47+A plain click drops a selection. Ctrl-Ins with nothing selected does nothing, and never reaches the shell.
48+
34 ## Work with the file and the shell side by side49 ## Work with the file and the shell side by side
35 50
36 A terminal is an ordinary window, so the window commands all apply to it:51 A terminal is an ordinary window, so the window commands all apply to it:
modified docs/en/reference/keyboard.md +4 -0
@@ -152,6 +152,9 @@ A terminal window in front gets **every key except** the function keys, `Alt-X`
152152 | Key | Action |
153153 | --- | --- |
154154 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
155+| `Shift-↑` `Shift-↓` | Select whole lines, from the shell's cursor line |
156+| `Ctrl-Ins` | Copy the selection (also **Edit ▸ Copy**) |
157+| `Shift-Ins` | Paste the editor's clipboard into the shell (also **Edit ▸ Paste**) |
155158 | anything else not reserved above | Sent to the shell, returning the view to the live screen |
156159
157160 The exact byte each key sends is in [Terminal windows](terminal.md).
@@ -184,4 +187,5 @@ Handled when the tree window has the focus. The full rules are in [Project tree]
184187 | Click `[■]` | Fill the desktop with the window |
185188 | Click `[▬]` | Put a filled window back where it was |
186189 | Wheel over a terminal | Scroll three lines through its history |
190+| Drag over a terminal | Select text; a click drops the selection |
187191 | Click a tree row | Highlight it; a second click opens it |
@@ -152,6 +152,9 @@ A terminal window in front gets **every key except** the function keys, `Alt-X`
152 | Key | Action |152 | Key | Action |
153 | --- | --- |153 | --- | --- |
154 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |154 | `Shift-PgUp` `Shift-PgDn` | Read back / forward one screenful through the history |
155+| `Shift-↑` `Shift-↓` | Select whole lines, from the shell's cursor line |
156+| `Ctrl-Ins` | Copy the selection (also **Edit ▸ Copy**) |
157+| `Shift-Ins` | Paste the editor's clipboard into the shell (also **Edit ▸ Paste**) |
155 | anything else not reserved above | Sent to the shell, returning the view to the live screen |158 | anything else not reserved above | Sent to the shell, returning the view to the live screen |
156 159
157 The exact byte each key sends is in [Terminal windows](terminal.md).160 The exact byte each key sends is in [Terminal windows](terminal.md).
@@ -184,4 +187,5 @@ Handled when the tree window has the focus. The full rules are in [Project tree]
184 | Click `[■]` | Fill the desktop with the window |187 | Click `[■]` | Fill the desktop with the window |
185 | Click `[▬]` | Put a filled window back where it was |188 | Click `[▬]` | Put a filled window back where it was |
186 | Wheel over a terminal | Scroll three lines through its history |189 | Wheel over a terminal | Scroll three lines through its history |
190+| Drag over a terminal | Select text; a click drops the selection |
187 | Click a tree row | Highlight it; a second click opens it |191 | Click a tree row | Highlight it; a second click opens it |
modified docs/en/reference/languages.md +32 -9
@@ -12,6 +12,7 @@ A file's **extension** decides whenever it is one of these:
1212 | `.toml` | TOML |
1313 | `.yaml`, `.yml` | YAML |
1414 | `.md`, `.markdown` | Markdown |
15+| `.adoc`, `.asciidoc` | AsciiDoc |
1516 | `.js`, `.mjs`, `.cjs` | JavaScript |
1617 | `.html`, `.htm` | HTML |
1718 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
@@ -49,22 +50,22 @@ Every scanner produces the same vocabulary of classes, and each maps to one them
4950 | Class | Theme key | Produced by |
5051 | --- | --- | --- |
5152 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
52-| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile |
53+| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
5354 | `type` | `syntax.type` | Go, TOML (table headers), YAML (tags) |
5455 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |
55-| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML and XML (entities) |
56+| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML and XML (entities), AsciiDoc |
5657 | `function` | `syntax.function` | Go, JavaScript, shell (the command) |
57-| `string` | `syntax.string` | all |
58+| `string` | `syntax.string` | all, AsciiDoc |
5859 | `char` | `syntax.char` | Go |
5960 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
60-| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile |
61+| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
6162 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (block scalar headers), XML, Dockerfile |
62-| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile |
63-| `heading` | `syntax.heading` | Markdown |
63+| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile, AsciiDoc |
64+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
6465 | `tag` | `syntax.tag` | HTML, XML |
65-| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (flags) |
66-| `emphasis` | `syntax.emphasis` | Markdown |
67-| `link` | `syntax.link` | Markdown |
66+| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (flags), AsciiDoc |
67+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
68+| `link` | `syntax.link` | Markdown, AsciiDoc |
6869
6970 ## Go
7071
@@ -129,6 +130,28 @@ A fenced block is **one colour whatever language it announces**: ```` ```go ````
129130
130131 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.
131132
133+## AsciiDoc
134+
135+| Recognised | As |
136+| --- | --- |
137+| `= Title` … `====== Title`, and `# Title` … `###### Title` | the whole line as a heading |
138+| `*bold*`, `**bold**`, `_italic_`, `__italic__` | emphasis |
139+| `` `mono` `` | string |
140+| `https://…`, `link:…[text]`, `xref:…[text]`, `mailto:…[]`, `image:…[]`, `<<anchor>>`, `<<anchor,text>>` | the whole thing as a link |
141+| `image::…[]`, `include::…[]`, `toc::[]` on a line of their own | the whole line as a link |
142+| `{attribute}` | constant |
143+| `:name: value`, `:name!:` | the `:name:` as attribute; the value as prose |
144+| `[source,go]`, `[NOTE]`, `[[anchor]]` on a line of their own | the whole line as attribute |
145+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | the label as keyword |
146+| `.Block title` | emphasis |
147+| `* `, `** `, `- `, `. `, `.. `, `1. ` | the marker as punctuation |
148+| `====`, `****`, `____`, `--`, `|===` | punctuation; the lines between them are prose |
149+| `|` in a table row | punctuation; the cells are prose |
150+| `----`, `....`, `++++` blocks | the whole block, delimiters included, as a string |
151+| `////` blocks and `//` lines | comment |
152+
153+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.
154+
132155 ## JavaScript
133156
134157 | Recognised | As |
@@ -12,6 +12,7 @@ A file's **extension** decides whenever it is one of these:
12 | `.toml` | TOML |12 | `.toml` | TOML |
13 | `.yaml`, `.yml` | YAML |13 | `.yaml`, `.yml` | YAML |
14 | `.md`, `.markdown` | Markdown |14 | `.md`, `.markdown` | Markdown |
15+| `.adoc`, `.asciidoc` | AsciiDoc |
15 | `.js`, `.mjs`, `.cjs` | JavaScript |16 | `.js`, `.mjs`, `.cjs` | JavaScript |
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 |
@@ -49,22 +50,22 @@ Every scanner produces the same vocabulary of classes, and each maps to one them
49 | Class | Theme key | Produced by |50 | Class | Theme key | Produced by |
50 | --- | --- | --- |51 | --- | --- | --- |
51 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |52 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
52-| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile |53+| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
53 | `type` | `syntax.type` | Go, TOML (table headers), YAML (tags) |54 | `type` | `syntax.type` | Go, TOML (table headers), YAML (tags) |
54 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |55 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins and expansions), YAML (anchors and aliases), Dockerfile (variables) |
55-| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML and XML (entities) |56+| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML and XML (entities), AsciiDoc |
56 | `function` | `syntax.function` | Go, JavaScript, shell (the command) |57 | `function` | `syntax.function` | Go, JavaScript, shell (the command) |
57-| `string` | `syntax.string` | all |58+| `string` | `syntax.string` | all, AsciiDoc |
58 | `char` | `syntax.char` | Go |59 | `char` | `syntax.char` | Go |
59 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |60 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
60-| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile |61+| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
61 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (block scalar headers), XML, Dockerfile |62 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (block scalar headers), XML, Dockerfile |
62-| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile |63+| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile, AsciiDoc |
63-| `heading` | `syntax.heading` | Markdown |64+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
64 | `tag` | `syntax.tag` | HTML, XML |65 | `tag` | `syntax.tag` | HTML, XML |
65-| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (flags) |66+| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (flags), AsciiDoc |
66-| `emphasis` | `syntax.emphasis` | Markdown |67+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
67-| `link` | `syntax.link` | Markdown |68+| `link` | `syntax.link` | Markdown, AsciiDoc |
68 69
69 ## Go70 ## Go
70 71
@@ -129,6 +130,28 @@ A fenced block is **one colour whatever language it announces**: ```` ```go ````
129 130
130 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.131 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.
131 132
133+## AsciiDoc
134+
135+| Recognised | As |
136+| --- | --- |
137+| `= Title` … `====== Title`, and `# Title` … `###### Title` | the whole line as a heading |
138+| `*bold*`, `**bold**`, `_italic_`, `__italic__` | emphasis |
139+| `` `mono` `` | string |
140+| `https://…`, `link:…[text]`, `xref:…[text]`, `mailto:…[]`, `image:…[]`, `<<anchor>>`, `<<anchor,text>>` | the whole thing as a link |
141+| `image::…[]`, `include::…[]`, `toc::[]` on a line of their own | the whole line as a link |
142+| `{attribute}` | constant |
143+| `:name: value`, `:name!:` | the `:name:` as attribute; the value as prose |
144+| `[source,go]`, `[NOTE]`, `[[anchor]]` on a line of their own | the whole line as attribute |
145+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | the label as keyword |
146+| `.Block title` | emphasis |
147+| `* `, `** `, `- `, `. `, `.. `, `1. ` | the marker as punctuation |
148+| `====`, `****`, `____`, `--`, `|===` | punctuation; the lines between them are prose |
149+| `|` in a table row | punctuation; the cells are prose |
150+| `----`, `....`, `++++` blocks | the whole block, delimiters included, as a string |
151+| `////` blocks and `//` lines | comment |
152+
153+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.
154+
132 ## JavaScript155 ## JavaScript
133 156
134 | Recognised | As |157 | Recognised | As |
modified docs/en/reference/terminal.md +25 -4
@@ -35,7 +35,7 @@ Neither requires a file to be open.
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.
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/fr/explanation/architecture.md +2 -2
@@ -52,7 +52,7 @@ Tout ce qui était un `"turbo-go"`, un `"gopls"` ou un `"go.mod"` en dur quelque
5252
5353 ## Pourquoi l'analyseur Go est ici et pas dans la bibliothèque
5454
55-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 objet — la configuration d'un projet est du TOML ou du YAML, sa documentation du Markdown, ses scripts du shell, sa construction d'image un Dockerfile.
55+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 objet — la configuration d'un projet est du TOML ou du YAML, sa documentation du Markdown, ses scripts du shell, sa construction d'image un Dockerfile.
5656
5757 Go n'en fait pas partie. Le langage qui *définit* un éditeur est enregistré par cet éditeur, ce qui explique qu'un fichier `.rs` s'ouvre ici en texte brut et qu'un fichier `.go` s'ouvre en texte brut dans Turbo Rust.
5858
@@ -63,7 +63,7 @@ L'analyseur Go est aussi celui qui ressemble le *moins* aux autres. Tous les lan
6363 | Était | Est |
6464 | --- | --- |
6565 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |
66-| `internal/syntax` — six langages | `turbo-core/syntax` — huit, plus un registre ; Go vit ici |
66+| `internal/syntax` — six langages | `turbo-core/syntax` — neuf, plus un registre ; Go vit ici |
6767 | `internal/app` avec une constante `Name` | `turbo-core/app` recevant un `profile.Profile` |
6868 | `internal/lsp` codant gopls en dur | `turbo-core/lsp` recevant un `profile.Server` |
6969 | `moduleRoot` dans `main.go` | `app.ProjectRoot(p, files)`, avec `go.mod` dans le profil |
@@ -52,7 +52,7 @@ Tout ce qui était un `"turbo-go"`, un `"gopls"` ou un `"go.mod"` en dur quelque
52 52
53 ## Pourquoi l'analyseur Go est ici et pas dans la bibliothèque53 ## Pourquoi l'analyseur Go est ici et pas dans la bibliothèque
54 54
55-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 objet — la configuration d'un projet est du TOML ou du YAML, sa documentation du Markdown, ses scripts du shell, sa construction d'image un Dockerfile.55+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 objet — la configuration d'un projet est du TOML ou du YAML, sa documentation du Markdown, ses scripts du shell, sa construction d'image un Dockerfile.
56 56
57 Go n'en fait pas partie. Le langage qui *définit* un éditeur est enregistré par cet éditeur, ce qui explique qu'un fichier `.rs` s'ouvre ici en texte brut et qu'un fichier `.go` s'ouvre en texte brut dans Turbo Rust.57 Go n'en fait pas partie. Le langage qui *définit* un éditeur est enregistré par cet éditeur, ce qui explique qu'un fichier `.rs` s'ouvre ici en texte brut et qu'un fichier `.go` s'ouvre en texte brut dans Turbo Rust.
58 58
@@ -63,7 +63,7 @@ L'analyseur Go est aussi celui qui ressemble le *moins* aux autres. Tous les lan
63 | Était | Est |63 | Était | Est |
64 | --- | --- |64 | --- | --- |
65 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |65 | `internal/buffer`, `internal/ui`, `internal/editor`, … | `turbo-core/buffer`, `turbo-core/ui`, `turbo-core/editor`, … |
66-| `internal/syntax` — six langages | `turbo-core/syntax` — huit, plus un registre ; Go vit ici |66+| `internal/syntax` — six langages | `turbo-core/syntax` — neuf, plus un registre ; Go vit ici |
67 | `internal/app` avec une constante `Name` | `turbo-core/app` recevant un `profile.Profile` |67 | `internal/app` avec une constante `Name` | `turbo-core/app` recevant un `profile.Profile` |
68 | `internal/lsp` codant gopls en dur | `turbo-core/lsp` recevant un `profile.Server` |68 | `internal/lsp` codant gopls en dur | `turbo-core/lsp` recevant un `profile.Server` |
69 | `moduleRoot` dans `main.go` | `app.ProjectRoot(p, files)`, avec `go.mod` dans le profil |69 | `moduleRoot` dans `main.go` | `app.ProjectRoot(p, files)`, avec `go.mod` dans le profil |
modified docs/fr/explanation/colouring-and-completion.md +3 -3
@@ -34,11 +34,11 @@ Analyser tout le fichier à chaque frappe paraît coûteux, et le serait. Cela n
3434
3535 **Un langage n'est coloré que si quelqu'un a écrit un scanner pour lui.** Il n'existe aucun langage de définition dans lequel écrire une définition : chacun est du code Go.
3636
37-Huit d'entre eux — TOML, YAML, Markdown, JavaScript, HTML, XML, les Dockerfiles et le shell — vivent dans turbo-core, parce que tout éditeur bâti dessus les rencontre quel que soit son langage. L'analyseur Go vit ici, dans `internal/golang`, et est enregistré au démarrage par `syntax.Register`. C'est pourquoi un fichier `.rs` s'ouvre en texte brut dans Turbo Go : cet éditeur enregistre Go et rien d'autre.
37+Neuf d'entre eux — TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, les Dockerfiles et le shell — vivent dans turbo-core, parce que tout éditeur bâti dessus les rencontre quel que soit son langage. L'analyseur Go vit ici, dans `internal/golang`, et est enregistré au démarrage par `syntax.Register`. C'est pourquoi un fichier `.rs` s'ouvre en texte brut dans Turbo Go : cet éditeur enregistre Go et rien d'autre.
3838
3939 C'est une vraie limitation, et elle a été acceptée délibérément : ceci est un éditeur pour Go. Un coloriseur générique aurait apporté une dépendance, un format de définition, et un écart permanent entre « ce que le coloriseur croit que Go est » et ce que Go est.
4040
41-### Les huit autres langages
41+### Les neuf autres langages
4242
4343 Le TOML est venu en premier, et il a mérité son scanner en étant incontournable : l'éditeur lit deux fichiers TOML — les fichiers de thème et le `.turbo-go/settings.toml` d'un projet — et tous deux sont faits pour être édités dans l'éditeur lui-même. Livrer un fichier de réglages plein de commentaires explicatifs puis l'afficher en gris uniforme aurait été curieux.
4444
@@ -57,7 +57,7 @@ La règle qui les unit est qu'un scanner **ne devine rien**. Là où une constru
5757
5858 ### Cinq classes dont Go n'a rien à dire
5959
60-Les douze classes que produit le tokeniseur Go couvrent presque entièrement les huit autres langages — une chaîne est une chaîne dans tous. Cinq choses n'avaient pas de place : un titre Markdown, ses emphases et ses liens, une balise et un attribut HTML.
60+Les douze classes que produit le tokeniseur Go couvrent presque entièrement les neuf autres langages — une chaîne est une chaîne dans tous. Cinq choses n'avaient pas de place : un titre Markdown, ses emphases et ses liens, une balise et un attribut HTML.
6161
6262 Réutiliser les classes existantes était l'option la moins chère, et c'est celle retenue pour le TOML, où un en-tête de table se lit réellement comme un type et une clé comme un identifiant. Elle ne tient pas pour les langages de balisage : un titre n'est pas un mot-clé, une balise non plus, et un thème qui voudrait des titres discrets et des mots-clés voyants ne pourrait pas le dire. D'où `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` et `syntax.link`.
6363
@@ -34,11 +34,11 @@ Analyser tout le fichier à chaque frappe paraît coûteux, et le serait. Cela n
34 34
35 **Un langage n'est coloré que si quelqu'un a écrit un scanner pour lui.** Il n'existe aucun langage de définition dans lequel écrire une définition : chacun est du code Go.35 **Un langage n'est coloré que si quelqu'un a écrit un scanner pour lui.** Il n'existe aucun langage de définition dans lequel écrire une définition : chacun est du code Go.
36 36
37-Huit d'entre eux — TOML, YAML, Markdown, JavaScript, HTML, XML, les Dockerfiles et le shell — vivent dans turbo-core, parce que tout éditeur bâti dessus les rencontre quel que soit son langage. L'analyseur Go vit ici, dans `internal/golang`, et est enregistré au démarrage par `syntax.Register`. C'est pourquoi un fichier `.rs` s'ouvre en texte brut dans Turbo Go : cet éditeur enregistre Go et rien d'autre.37+Neuf d'entre eux — TOML, YAML, Markdown, AsciiDoc, JavaScript, HTML, XML, les Dockerfiles et le shell — vivent dans turbo-core, parce que tout éditeur bâti dessus les rencontre quel que soit son langage. L'analyseur Go vit ici, dans `internal/golang`, et est enregistré au démarrage par `syntax.Register`. C'est pourquoi un fichier `.rs` s'ouvre en texte brut dans Turbo Go : cet éditeur enregistre Go et rien d'autre.
38 38
39 C'est une vraie limitation, et elle a été acceptée délibérément : ceci est un éditeur pour Go. Un coloriseur générique aurait apporté une dépendance, un format de définition, et un écart permanent entre « ce que le coloriseur croit que Go est » et ce que Go est.39 C'est une vraie limitation, et elle a été acceptée délibérément : ceci est un éditeur pour Go. Un coloriseur générique aurait apporté une dépendance, un format de définition, et un écart permanent entre « ce que le coloriseur croit que Go est » et ce que Go est.
40 40
41-### Les huit autres langages41+### Les neuf autres langages
42 42
43 Le TOML est venu en premier, et il a mérité son scanner en étant incontournable : l'éditeur lit deux fichiers TOML — les fichiers de thème et le `.turbo-go/settings.toml` d'un projet — et tous deux sont faits pour être édités dans l'éditeur lui-même. Livrer un fichier de réglages plein de commentaires explicatifs puis l'afficher en gris uniforme aurait été curieux.43 Le TOML est venu en premier, et il a mérité son scanner en étant incontournable : l'éditeur lit deux fichiers TOML — les fichiers de thème et le `.turbo-go/settings.toml` d'un projet — et tous deux sont faits pour être édités dans l'éditeur lui-même. Livrer un fichier de réglages plein de commentaires explicatifs puis l'afficher en gris uniforme aurait été curieux.
44 44
@@ -57,7 +57,7 @@ La règle qui les unit est qu'un scanner **ne devine rien**. Là où une constru
57 57
58 ### Cinq classes dont Go n'a rien à dire58 ### Cinq classes dont Go n'a rien à dire
59 59
60-Les douze classes que produit le tokeniseur Go couvrent presque entièrement les huit autres langages — une chaîne est une chaîne dans tous. Cinq choses n'avaient pas de place : un titre Markdown, ses emphases et ses liens, une balise et un attribut HTML.60+Les douze classes que produit le tokeniseur Go couvrent presque entièrement les neuf autres langages — une chaîne est une chaîne dans tous. Cinq choses n'avaient pas de place : un titre Markdown, ses emphases et ses liens, une balise et un attribut HTML.
61 61
62 Réutiliser les classes existantes était l'option la moins chère, et c'est celle retenue pour le TOML, où un en-tête de table se lit réellement comme un type et une clé comme un identifiant. Elle ne tient pas pour les langages de balisage : un titre n'est pas un mot-clé, une balise non plus, et un thème qui voudrait des titres discrets et des mots-clés voyants ne pourrait pas le dire. D'où `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` et `syntax.link`.62 Réutiliser les classes existantes était l'option la moins chère, et c'est celle retenue pour le TOML, où un en-tête de table se lit réellement comme un type et une clé comme un identifiant. Elle ne tient pas pour les langages de balisage : un titre n'est pas un mot-clé, une balise non plus, et un thème qui voudrait des titres discrets et des mots-clés voyants ne pourrait pas le dire. D'où `syntax.heading`, `syntax.tag`, `syntax.attribute`, `syntax.emphasis` et `syntax.link`.
63 63
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/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
@@ -142,6 +142,9 @@ Une fenêtre terminal au premier plan reçoit **toutes les touches sauf** les to
142142 | Touche | Action |
143143 | --- | --- |
144144 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |
145+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières, depuis la ligne du curseur du shell |
146+| `Ctrl-Inser` | Copier la sélection (aussi **Édition ▸ Copier**) |
147+| `Maj-Inser` | Coller le presse-papiers de l'éditeur dans le shell (aussi **Édition ▸ Coller**) |
145148 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |
146149
147150 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).
@@ -174,4 +177,5 @@ Traitées quand la fenêtre de l'arbre a le focus. Les règles complètes sont d
174177 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |
175178 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |
176179 | Molette sur un terminal | Défiler de trois lignes dans son historique |
180+| Glisser sur un terminal | Sélectionner du texte ; un clic abandonne la sélection |
177181 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |
@@ -142,6 +142,9 @@ Une fenêtre terminal au premier plan reçoit **toutes les touches sauf** les to
142 | Touche | Action |142 | Touche | Action |
143 | --- | --- |143 | --- | --- |
144 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |144 | `Maj-Page↑` `Maj-Page↓` | Reculer / avancer d'un écran dans l'historique |
145+| `Maj-↑` `Maj-↓` | Sélectionner des lignes entières, depuis la ligne du curseur du shell |
146+| `Ctrl-Inser` | Copier la sélection (aussi **Édition ▸ Copier**) |
147+| `Maj-Inser` | Coller le presse-papiers de l'éditeur dans le shell (aussi **Édition ▸ Coller**) |
145 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |148 | toute autre touche non réservée ci-dessus | Envoyée au shell, ramenant la vue à l'écran vivant |
146 149
147 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).150 Les octets exacts envoyés par chaque touche sont dans [Fenêtres terminal](terminal.md).
@@ -174,4 +177,5 @@ Traitées quand la fenêtre de l'arbre a le focus. Les règles complètes sont d
174 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |177 | Clic sur `[■]` | Donner tout le bureau à la fenêtre |
175 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |178 | Clic sur `[▬]` | Remettre une fenêtre agrandie à sa taille précédente |
176 | Molette sur un terminal | Défiler de trois lignes dans son historique |179 | Molette sur un terminal | Défiler de trois lignes dans son historique |
180+| Glisser sur un terminal | Sélectionner du texte ; un clic abandonne la sélection |
177 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |181 | Clic sur une ligne d'arbre | La surligner ; un second clic l'ouvre |
modified docs/fr/reference/languages.md +32 -9
@@ -12,6 +12,7 @@ L'**extension** d'un fichier décide dès qu'elle fait partie de celles-ci :
1212 | `.toml` | TOML |
1313 | `.yaml`, `.yml` | YAML |
1414 | `.md`, `.markdown` | Markdown |
15+| `.adoc`, `.asciidoc` | AsciiDoc |
1516 | `.js`, `.mjs`, `.cjs` | JavaScript |
1617 | `.html`, `.htm` | HTML |
1718 | `.xml`, `.xsd`, `.xsl`, `.xslt`, `.svg`, `.plist`, `.csproj`, `.pom` | XML |
@@ -49,22 +50,22 @@ Tous les scanners produisent le même vocabulaire de classes, et chacune corresp
4950 | Classe | Clé de thème | Produite par |
5051 | --- | --- | --- |
5152 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
52-| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile |
53+| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
5354 | `type` | `syntax.type` | Go, TOML (en-têtes de table), YAML (étiquettes) |
5455 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |
55-| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML et XML (entités) |
56+| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML et XML (entités), AsciiDoc |
5657 | `function` | `syntax.function` | Go, JavaScript, shell (la commande) |
57-| `string` | `syntax.string` | tous |
58+| `string` | `syntax.string` | tous, AsciiDoc |
5859 | `char` | `syntax.char` | Go |
5960 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
60-| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile |
61+| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
6162 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (en-têtes de scalaire de bloc), XML, Dockerfile |
62-| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile |
63-| `heading` | `syntax.heading` | Markdown |
63+| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile, AsciiDoc |
64+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
6465 | `tag` | `syntax.tag` | HTML, XML |
65-| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (options) |
66-| `emphasis` | `syntax.emphasis` | Markdown |
67-| `link` | `syntax.link` | Markdown |
66+| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (options), AsciiDoc |
67+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
68+| `link` | `syntax.link` | Markdown, AsciiDoc |
6869
6970 ## Go
7071
@@ -129,6 +130,28 @@ Un bloc clôturé est **d'une seule couleur quel que soit le langage annoncé**
129130
130131 La suite de marqueurs qui ouvre une emphase doit être fermée par une suite de même longueur, de sorte que `**gras**` fasse un seul span et non deux italiques.
131132
133+## AsciiDoc
134+
135+| Reconnu | Comme |
136+| --- | --- |
137+| `= Titre` … `====== Titre`, et `# Titre` … `###### Titre` | toute la ligne en heading |
138+| `*gras*`, `**gras**`, `_italique_`, `__italique__` | emphasis |
139+| `` `mono` `` | string |
140+| `https://…`, `link:…[texte]`, `xref:…[texte]`, `mailto:…[]`, `image:…[]`, `<<ancre>>`, `<<ancre,texte>>` | l'ensemble en link |
141+| `image::…[]`, `include::…[]`, `toc::[]` seuls sur leur ligne | toute la ligne en link |
142+| `{attribut}` | constant |
143+| `:nom: valeur`, `:nom!:` | le `:nom:` en attribute ; la valeur en prose |
144+| `[source,go]`, `[NOTE]`, `[[ancre]]` seuls sur leur ligne | toute la ligne en attribute |
145+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | l'étiquette en keyword |
146+| `.Titre de bloc` | emphasis |
147+| `* `, `** `, `- `, `. `, `.. `, `1. ` | le marqueur en punctuation |
148+| `====`, `****`, `____`, `--`, `|===` | punctuation ; les lignes entre eux sont de la prose |
149+| `|` dans une ligne de tableau | punctuation ; les cellules sont de la prose |
150+| blocs `----`, `....`, `++++` | tout le bloc, délimiteurs compris, en string |
151+| blocs `////` et lignes `//` | comment |
152+
153+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.
154+
132155 ## JavaScript
133156
134157 | Reconnu | Comme |
@@ -12,6 +12,7 @@ L'**extension** d'un fichier décide dès qu'elle fait partie de celles-ci :
12 | `.toml` | TOML |12 | `.toml` | TOML |
13 | `.yaml`, `.yml` | YAML |13 | `.yaml`, `.yml` | YAML |
14 | `.md`, `.markdown` | Markdown |14 | `.md`, `.markdown` | Markdown |
15+| `.adoc`, `.asciidoc` | AsciiDoc |
15 | `.js`, `.mjs`, `.cjs` | JavaScript |16 | `.js`, `.mjs`, `.cjs` | JavaScript |
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 |
@@ -49,22 +50,22 @@ Tous les scanners produisent le même vocabulaire de classes, et chacune corresp
49 | Classe | Clé de thème | Produite par |50 | Classe | Clé de thème | Produite par |
50 | --- | --- | --- |51 | --- | --- | --- |
51 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |52 | `identifier` | `syntax.identifier` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
52-| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile |53+| `keyword` | `syntax.keyword` | Go, JavaScript, shell, HTML (doctype), XML, Dockerfile, AsciiDoc |
53 | `type` | `syntax.type` | Go, TOML (en-têtes de table), YAML (étiquettes) |54 | `type` | `syntax.type` | Go, TOML (en-têtes de table), YAML (étiquettes) |
54 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |55 | `builtin` | `syntax.builtin` | Go, JavaScript, shell (builtins et expansions), YAML (ancres et alias), Dockerfile (variables) |
55-| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML et XML (entités) |56+| `constant` | `syntax.constant` | Go, TOML, JavaScript, shell, YAML, HTML et XML (entités), AsciiDoc |
56 | `function` | `syntax.function` | Go, JavaScript, shell (la commande) |57 | `function` | `syntax.function` | Go, JavaScript, shell (la commande) |
57-| `string` | `syntax.string` | tous |58+| `string` | `syntax.string` | tous, AsciiDoc |
58 | `char` | `syntax.char` | Go |59 | `char` | `syntax.char` | Go |
59 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |60 | `number` | `syntax.number` | Go, TOML, JavaScript, shell, YAML, Dockerfile |
60-| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile |61+| `comment` | `syntax.comment` | Go, TOML, JavaScript, shell, HTML, YAML, XML, Dockerfile, AsciiDoc |
61 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (en-têtes de scalaire de bloc), XML, Dockerfile |62 | `operator` | `syntax.operator` | Go, TOML, JavaScript, shell, HTML, YAML (en-têtes de scalaire de bloc), XML, Dockerfile |
62-| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile |63+| `punctuation` | `syntax.punctuation` | Go, TOML, JavaScript, shell, Markdown, YAML, Dockerfile, AsciiDoc |
63-| `heading` | `syntax.heading` | Markdown |64+| `heading` | `syntax.heading` | Markdown, AsciiDoc |
64 | `tag` | `syntax.tag` | HTML, XML |65 | `tag` | `syntax.tag` | HTML, XML |
65-| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (options) |66+| `attribute` | `syntax.attribute` | HTML, XML, Dockerfile (options), AsciiDoc |
66-| `emphasis` | `syntax.emphasis` | Markdown |67+| `emphasis` | `syntax.emphasis` | Markdown, AsciiDoc |
67-| `link` | `syntax.link` | Markdown |68+| `link` | `syntax.link` | Markdown, AsciiDoc |
68 69
69 ## Go70 ## Go
70 71
@@ -129,6 +130,28 @@ Un bloc clôturé est **d'une seule couleur quel que soit le langage annoncé**
129 130
130 La suite de marqueurs qui ouvre une emphase doit être fermée par une suite de même longueur, de sorte que `**gras**` fasse un seul span et non deux italiques.131 La suite de marqueurs qui ouvre une emphase doit être fermée par une suite de même longueur, de sorte que `**gras**` fasse un seul span et non deux italiques.
131 132
133+## AsciiDoc
134+
135+| Reconnu | Comme |
136+| --- | --- |
137+| `= Titre` … `====== Titre`, et `# Titre` … `###### Titre` | toute la ligne en heading |
138+| `*gras*`, `**gras**`, `_italique_`, `__italique__` | emphasis |
139+| `` `mono` `` | string |
140+| `https://…`, `link:…[texte]`, `xref:…[texte]`, `mailto:…[]`, `image:…[]`, `<<ancre>>`, `<<ancre,texte>>` | l'ensemble en link |
141+| `image::…[]`, `include::…[]`, `toc::[]` seuls sur leur ligne | toute la ligne en link |
142+| `{attribut}` | constant |
143+| `:nom: valeur`, `:nom!:` | le `:nom:` en attribute ; la valeur en prose |
144+| `[source,go]`, `[NOTE]`, `[[ancre]]` seuls sur leur ligne | toute la ligne en attribute |
145+| `NOTE:`, `TIP:`, `IMPORTANT:`, `WARNING:`, `CAUTION:` | l'étiquette en keyword |
146+| `.Titre de bloc` | emphasis |
147+| `* `, `** `, `- `, `. `, `.. `, `1. ` | le marqueur en punctuation |
148+| `====`, `****`, `____`, `--`, `|===` | punctuation ; les lignes entre eux sont de la prose |
149+| `|` dans une ligne de tableau | punctuation ; les cellules sont de la prose |
150+| blocs `----`, `....`, `++++` | tout le bloc, délimiteurs compris, en string |
151+| blocs `////` et lignes `//` | comment |
152+
153+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.
154+
132 ## JavaScript155 ## JavaScript
133 156
134 | Reconnu | Comme |157 | Reconnu | Comme |
modified docs/fr/reference/terminal.md +25 -4
@@ -35,7 +35,7 @@ Aucun des deux n'exige qu'un fichier soit ouvert.
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.
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/golang/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: go, toml, yaml, markdown, javascript, html, xml, dockerfile,
9+# editor uses: go, toml, yaml, markdown, asciidoc, javascript, html, xml, dockerfile,
1010 # bash. Leave it out and the snippet is offered everywhere.
1111 #
1212 # Your own snippets, shared across every project, go in:
@@ -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: go, toml, yaml, markdown, javascript, html, xml, dockerfile,9+# editor uses: go, toml, yaml, markdown, asciidoc, javascript, 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 # Your own snippets, shared across every project, go in:12 # Your own snippets, shared across every project, go in:
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 Go"
@@ -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 Go"10 ABOUT="Turbo Go"