turbo-editors/turbo-gopublic Fork 0
v1.0.2
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.

use-a-terminal.md · 61 lines · 3.5 KBmarkdown Blame HistoryRaw
📦 Turbo Go 3d7798b k33g 8h ago1# How to run shell commands without leaving the editor
2
3This guide shows how to open a terminal window, build and test the code you are editing in it, and get back to the file. It assumes you already have Turbo Go running with a file open.
4
5## Open a terminal
6
7Press `F8`, or choose **Window ▸ New terminal**.
8
9A new window opens running your shell, in the directory of the file you were editing. That is normally the directory you want: `go build ./...` and `git diff` both act on the package you are looking at.
10
11The window is called after the shell, and renames itself when a program inside it sets a title — `vim`, `htop` and `ssh` all do.
12
13## Run something
14
15Type into it as you would into any terminal. The shell gets nearly every key, including the ones the editor would otherwise use: `Ctrl-C` interrupts, `Ctrl-W` deletes a word, `Ctrl-R` searches the history.
16
17What the editor keeps is short, and deliberate — it is the way back out:
18
19| Key | Effect, even with a terminal in front |
20| --- | --- |
21| `F8` | Open another terminal |
22| `F6` | Move to the next window |
23| `F10` | Open the menu bar |
24| `F2` `F3` `F4` | Save, Open, New |
25| `Alt-1``Alt-9` | Bring that window forward |
26| `Alt-X` | Leave the editor |
27
28## Read back through what scrolled off
29
30`Shift-PgUp` and `Shift-PgDn` walk the history a screenful at a time; the mouse wheel moves three lines. Two thousand lines are kept.
31
32Typing anything brings you straight back to the live screen, so you never have to scroll back down before running the next command.
33
34## Work with the file and the shell side by side
35
36A terminal is an ordinary window, so the window commands all apply to it:
37
38- **Window ▸ Tile** puts the file and the terminal side by side.
39- **Window ▸ Maximise**, or the `[■]` box at the right of its title bar, gives the terminal the whole desktop while a build runs. The box then reads `[▬]`, and pressing it puts the window back.
40- Drag its bottom-right corner to resize it — the shell is told its new size, so `less` and `vim` reflow.
41
42## Close it
43
44`Ctrl-W` is the shell's, not the editor's, so closing a terminal is done another way:
45
46- **File ▸ Close**, or
47- click the `[x]` box in its top-left corner.
48
49Either ends the shell running in it. Nothing is asked first: a terminal holds a running process, not unsaved work, and closing the window is how you say you have finished with it. Leaving the editor closes every terminal at once.
50
51## Variants
52
53- **You want a different shell.** The shell is taken from `$SHELL`, falling back to `/bin/sh`; on Windows from `%COMSPEC%`, falling back to `cmd.exe`. Start the editor with `SHELL=/bin/zsh turbo-go` to change it for that run.
54- **No file is open.** The terminal starts in the directory the editor was started from.
55- **You are on Windows.** Terminal windows run in a pseudo-console (ConPTY), which needs Windows 10 version 1809 or later, and the shell is `%COMSPEC%` — cmd.exe. This path has been built and vetted but not yet run by the authors, who work on Linux and macOS. The first time you use it, try the five things it has to get right — `F8`, type `dir`, resize the window, run a menu command that says `output = "terminal"`, and interrupt a long one with `Ctrl-C` — and report whatever did not behave.
56
57## See also
58
59- Everything the terminal implements, exactly: [Terminal windows reference](../reference/terminal.md)
60- Why it runs a real shell rather than capturing command output: [Terminal windows](../explanation/terminal-windows.md)
61- The colours it uses: [Theme file format](../reference/themes.md)