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

📦 Turbo Go 3d7798b · on v1.0.1 · k33g · 9h ago
2026-08-31-tool-menus.md · 40 lines · 5.5 KBmarkdown
Blame HistoryOpen raw

Handoff — 2026-08-31 — Tool menus, and the terminal that showed nothing

State

All of it is merged. The user merged feature/go-format-lint into main as PR #7 (88a4c38) at the end of the session, carrying four things in the order they were done: the Go tools feature, its revision to three output destinations, the installer fix, and this session's two items. main is what to read now; the branch is spent.

The only uncommitted changes in the tree are the user's own: .tickets/issues/0004 and 0017 moved to state: closed. Leave them alone — the ticket files are theirs to edit.

The echo 'TADA' bug is fixed. Screen.Resize dropped previous-height rows from the top of the screen into scrollback whenever a terminal shrank. A terminal window is created at 80×24 and the first layout() shrinks it to its frame (about 76×20), so a command whose entire output was one line at row 0 lost it — while the blank rows below stayed. Whether the output arrived before or after that first resize decided whether it showed, which is why it looked intermittent. rowsToDrop(previous, height, cursorRow) in internal/terminal/screen_resize.go now drops only as many rows as the cursor needs.

A tool can name its own menu. menu = "Docker" in .turbo-go/tools.toml puts a Docker menu on the bar between Go and Help; absent means Go. Menus appear in the order their names first appear in the file, and the bar follows the file while the editor runs. Hot keys are assigned by the editor. All of it is in internal/app/toolmenus.go, internal/tools/tools.go and ui.MenuBar.SetMenus.

Quality gate PASS — 0 errors, 0 warnings, 0 smells, complexity 1567. Full suite green, and green under -race. Docs updated in both languages; internal/tools, internal/app, internal/ui and the root README in sync.

In flight

Nothing. Both items are finished, tested, documented and recorded.

Next steps

Nothing carried over. Eight tickets remain open and none was started: 0005 wasm plugins, 0008 a mini agent view, 0010 a version number in About, 0011 a website, 0012 more themes, 0015 Windows support for terminal windows, 0016 no shadow on tiled windows, 0018 a core library extracted from Turbo Go.

Open questions / blockers

None outstanding. Ticket 0017 also mentioned go mod init + touch main.go as menu items; it was never built, and the user closed the ticket anyway, so treat that idea as dropped rather than pending. It never fitted the shape of the feature — those create a project rather than run a command in one.

Also done, after the feature

demo/.turbo-go/tools.toml was brought up to date on request. It was regenerated from the template constant in internal/tools/create.go rather than hand-edited, so it is byte-for-byte what Go ▸ Create tools file writes today, with the user's own ~E~cho tool appended under menu = "Tools". Do the same if it goes stale again — hand-editing it is how it drifted from the generator in the first place (its header still described a terminal as the only output destination, two revisions after that stopped being true).

Watch out for

  • A hot-key clash is silent and every test passes. The bar answers the first menu whose key matches; a second menu claiming the same letter draws normally and simply never opens. Snippets and Search both wanted S earlier in this project and nothing caught it but driving the binary. TestNoTwoMenusShareAHotKey covers the fixed menus and TestNoCreatedMenuClashesWithAFixedOne the created ones — do not weaken either.
  • o belongs to Options and r to Run. Two test expectations written from intuition were wrong for this reason (Format gets For~m~at, and a menu written T~o~ols loses its o). If a hot-key test surprises you, check the taken set before the code. The nine letters in use are F E S R O W N G H.
  • refreshToolMenus calls SetMenus, which closes an open menu. That is deliberate — the open index points into the old slice — but it means a tools file changing on disk while a menu is down will close it. Rare, and better than dropping down whichever menu landed at that index.
  • The stamp is stat-based, not content-based. A file rewritten with identical size in the same modification-time tick will not rebuild the bar. In practice mtime resolution makes this unreachable; it is a deliberate trade against parsing the file on every keystroke.
  • The VT-emulator render harness is the technique that keeps finding these. It lives at /tmp/render/main.go (with run.sh and a tools.sh variant) and has to be copied into the module to run — go run refuses a file outside it that imports internal/…. Copy it to internal/terminal/tmprender/, run it, and delete it again before the quality gate. It found the Alt-S clash, the syntax.link colour clash, and confirmed both of this session's fixes.
  • internal/terminal/tmprender/ must not be left behind. It is a package main in an internal tree; go build ./... tolerates it but it would confuse the next reader and the installer warns about stray files in package main.
  • demo/ is the user's own project, mounted from their machine. Only tools.toml was touched, and deliberately: Format in that menu would rewrite demo/main.go, so no tool there was ever run. Ask before changing anything else under demo/.
  • The repository is on Codeberg over SSH, not GitHub, and the user does all the committing, pushing, merging and ticket-closing. Propose a commit message; do not commit.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Handoff — 2026-08-31 — Tool menus, and the terminal that showed nothing

## State

**All of it is merged.** The user merged `feature/go-format-lint` into `main` as PR #7 (`88a4c38`) at the end of the session, carrying four things in the order they were done: the Go tools feature, its revision to three output destinations, the installer fix, and this session's two items. `main` is what to read now; the branch is spent.

The only uncommitted changes in the tree are **the user's own**: `.tickets/issues/0004` and `0017` moved to `state: closed`. Leave them alone — the ticket files are theirs to edit.

**The `echo 'TADA'` bug is fixed.** `Screen.Resize` dropped `previous-height` rows from the top of the screen into scrollback whenever a terminal shrank. A terminal window is created at 80×24 and the first `layout()` shrinks it to its frame (about 76×20), so a command whose entire output was one line at row 0 lost it — while the blank rows below stayed. Whether the output arrived before or after that first resize decided whether it showed, which is why it looked intermittent. `rowsToDrop(previous, height, cursorRow)` in `internal/terminal/screen_resize.go` now drops only as many rows as the cursor needs.

**A tool can name its own menu.** `menu = "Docker"` in `.turbo-go/tools.toml` puts a Docker menu on the bar between Go and Help; absent means Go. Menus appear in the order their names first appear in the file, and the bar follows the file while the editor runs. Hot keys are assigned by the editor. All of it is in `internal/app/toolmenus.go`, `internal/tools/tools.go` and `ui.MenuBar.SetMenus`.

Quality gate PASS — 0 errors, 0 warnings, 0 smells, complexity 1567. Full suite green, and green under `-race`. Docs updated in both languages; `internal/tools`, `internal/app`, `internal/ui` and the root README in sync.

## In flight

Nothing. Both items are finished, tested, documented and recorded.

## Next steps

Nothing carried over. Eight tickets remain open and none was started: `0005` wasm plugins, `0008` a mini agent view, `0010` a version number in About, `0011` a website, `0012` more themes, `0015` Windows support for terminal windows, `0016` no shadow on tiled windows, `0018` a core library extracted from Turbo Go.

## Open questions / blockers

None outstanding. Ticket 0017 also mentioned `go mod init` + `touch main.go` as menu items; it was never built, and the user **closed the ticket anyway**, so treat that idea as dropped rather than pending. It never fitted the shape of the feature — those create a project rather than run a command in one.

## Also done, after the feature

`demo/.turbo-go/tools.toml` was brought up to date on request. It was **regenerated from the `template` constant in `internal/tools/create.go`** rather than hand-edited, so it is byte-for-byte what `Go ▸ Create tools file` writes today, with the user's own `~E~cho` tool appended under `menu = "Tools"`. Do the same if it goes stale again — hand-editing it is how it drifted from the generator in the first place (its header still described a terminal as the only output destination, two revisions after that stopped being true).

## Watch out for

- **A hot-key clash is silent and every test passes.** The bar answers the *first* menu whose key matches; a second menu claiming the same letter draws normally and simply never opens. `Snippets` and `Search` both wanted `S` earlier in this project and nothing caught it but driving the binary. `TestNoTwoMenusShareAHotKey` covers the fixed menus and `TestNoCreatedMenuClashesWithAFixedOne` the created ones — do not weaken either.
- **`o` belongs to Options and `r` to Run.** Two test expectations written from intuition were wrong for this reason (`Format` gets `For~m~at`, and a menu written `T~o~ols` loses its `o`). If a hot-key test surprises you, check the taken set before the code. The nine letters in use are `F E S R O W N G H`.
- **`refreshToolMenus` calls `SetMenus`, which closes an open menu.** That is deliberate — the open index points into the old slice — but it means a tools file changing on disk while a menu is down will close it. Rare, and better than dropping down whichever menu landed at that index.
- **The stamp is `stat`-based, not content-based.** A file rewritten with identical size in the same modification-time tick will not rebuild the bar. In practice mtime resolution makes this unreachable; it is a deliberate trade against parsing the file on every keystroke.
- **The VT-emulator render harness is the technique that keeps finding these.** It lives at `/tmp/render/main.go` (with `run.sh` and a `tools.sh` variant) and has to be **copied into the module** to run — `go run` refuses a file outside it that imports `internal/…`. Copy it to `internal/terminal/tmprender/`, run it, and **delete it again** before the quality gate. It found the `Alt-S` clash, the `syntax.link` colour clash, and confirmed both of this session's fixes.
- **`internal/terminal/tmprender/` must not be left behind.** It is a `package main` in an internal tree; `go build ./...` tolerates it but it would confuse the next reader and the installer warns about stray files in package main.
- **`demo/` is the user's own project, mounted from their machine.** Only `tools.toml` was touched, and deliberately: `Format` in that menu would rewrite `demo/main.go`, so no tool there was ever run. Ask before changing anything else under `demo/`.
- **The repository is on Codeberg over SSH**, not GitHub, and the user does all the committing, pushing, merging and ticket-closing. Propose a commit message; do not commit.