Visual Studio Code, rebuilt in Rust
Rust
test(terminal): compare the libghostty-vt terminal with 1.148.0 in ui-pair
rokartur62112e886f70
diff --git a/port/fixtures/terminal/backend.sh b/port/fixtures/terminal/backend.shnew file mode 100644index 00000000000..e502823b303--- /dev/null+++ b/port/fixtures/terminal/backend.sh@@ -0,0 +1,4 @@+# Output for steps-backend.json: mkdir /tmp/tbf && cp backend.sh /tmp/tbf && FOLDER=/tmp/tbf port/tools/ui-pair /tmp/tb port/fixtures/terminal/steps-backend.json dark+clear+printf '\033[31mred \033[1;32mbold\033[0m \033[4munder\033[0m \033[7minverse\033[0m \033[38;2;255;128;0mtruecolor\033[0m \033[38;5;141mindexed\033[0m\n'+printf '\342\234\214\357\270\217\360\237\221\215 \344\270\255\346\226\207 selectme end\n'diff --git a/port/fixtures/terminal/steps-backend.json b/port/fixtures/terminal/steps-backend.jsonnew file mode 100644index 00000000000..8b8296abba0--- /dev/null+++ b/port/fixtures/terminal/steps-backend.json@@ -0,0 +1,12 @@+[+ { "wait": 2000 },+ { "hotkey": ["ctrl", "`"] },+ { "wait": 4000 },+ { "type": "sh backend.sh" },+ { "key": "return" }, { "wait": 1500 },+ { "shot": "text" },+ { "doubleClick": [423, 550] }, { "wait": 500 },+ { "shot": "selection" },+ { "type": "echo cursor" }, { "wait": 500 },+ { "shot": "cursor" }+]diff --git a/port/ledger.md b/port/ledger.mdindex a0b7d1e363d..950599d4cc6 100644--- a/port/ledger.md+++ b/port/ledger.md@@ -42,7 +42,7 @@ Status: `open`, `in progress`, `waiting on Artur`, `later` (postponed), `done`,| Milestones | M21 uplift to VS Code 1.148.0 | in progress | Postponed by Artur, started 2026-12-01 (session 1). Starts after milestones 11 to 20 close on 1.147.0 and after milestone 22; until then every reference, baseline and ui-pair stays on 1.147.0. Plan: `port/plans/uplift-1.147.0-to-1.148.0.md`, short form in `port/notes.md` "VS Code 1.148.0" (`bun port/tools/uplift-diff.ts 1.148.0`, every change triaged; refreshed against the ledger with 17 rows still open). Of about 209,000 changed upstream lines, 6,548 are ported: about 3,500 Rust work, 1,977 lines of grammar data and colorize fixtures, about 770 that arrive with upstream or the reference's extensions, and 308 of the floating comment style, a gap older than the uplift. 100,284 lines are skipped: AI, chat, sessions, agent host, remote, GitHub sign-in, experiments, telemetry and the integrated browser. Every setup step and work item is an `M21 uplift` row below, with its check. Steps: 1) session 1 does the setup rows and milestones 7 to 11. 2) Session 2 does milestones 12 and 14: files, workspace, the remove-folder vetoes and SCM. 3) Session 3 does milestones 13 and 15 to 19. Sessions 2 and 3 can run in parallel after session 1. | The ledger names 1.148.0. Every row the diff touches is `verified`, `removed` or `n/a` again, or keeps its 1.147.0 status where the gap is older than the uplift (the floating comment style). The full check passes against the 1.148.0 reference. || Milestones | M22 split the port from the VS Code tree | done | Artur: `main` holds the Rust port only (`native/`, `port/`, the port's skills, README and licenses) and upstream VS Code is `upstream/` (ignored), checked out detached at the followed tag, never edited; an uplift moves it with `git -C upstream checkout <tag>`. Every build step and tool reads upstream from `upstream/` or the path in `VSCODE_SRC`. Decision (Artur): `main` kept its history: a fast-forward by the port's branch plus one commit that removes the VS Code tree; no orphan commit, no `git filter-repo`, no force-push. Port version: the followed VS Code version is `package.json`'s `version` in `VSCODE_SRC`, which `uplift-diff.ts` reads as its default `from` and package-app as its default `VERSION`; `VERSION` in main.rs (the API version extensions see) repeats it. | Steps 1 and 2 (branch `port-m22-split`): `VSCODE_SRC` resolved by `native/vscode_src.rs` (build scripts of app, diff, files; `env!("VSCODE_SRC")`), `port/tools/vscode-src.sh` and `port/tools/vscode-src.ts`; the dev app root is `VSCODE_SRC` (runtime env over the build's value), the host bundle stays in the checkout's `out-exthost/`; the upstream edits are `port/patches/src-*.patch` (build-exthost, on a copy in `out-exthost/build`) and `extensions-*.patch` (package-app), `port/product.json` is the overlay. Step 3 (branch `port-release`): one commit `git rm`s the VS Code tree (21458 files); `ThirdPartyNotices.txt` ships from `VSCODE_SRC`, `LICENSE.txt` from the repo root; `exthost`'s `proposed_api.rs`, `run-app-check`'s extensions default and the dev host's AMD modules (`build-exthost` links `node_modules` beside `out-exthost` to `VSCODE_SRC`'s) read `VSCODE_SRC`; a Studio mirror of a tree without `src/` links `upstream` to `~/Developer/vscode-ref` (`port/tools/studio`). Step 4: a clean clone builds, tests, packages and passes the full check (the README's Build section at 96b0e476067). `git ls-tree main` holds no upstream file. || Milestones | M23 Linux build | in progress | Branch `port-linux` (a Linux build container on the Studio). The app is macOS-only today: 24 files of `native/crates` call AppKit, Foundation, WebKit, Security or Core Foundation directly (objc2, core-foundation, security-framework); GPUI (`native/vendor/wu`) already has its Linux platform (Wayland and X11). Artur: Wayland is required, not a preview: every feature X11 has works in a Wayland session too, webviews included. Every macOS call goes behind `cfg(target_os = "macos")` with the Linux counterpart VS Code uses there, in the same function where the two are a few lines, in a `platform/linux.rs` beside a `platform/macos.rs` where they are not: webview (WebKitGTK through wry), file dialogs (xdg-desktop-portal, rfd), the application menu (drawn in the window: `window.titleBarStyle`, `window.menuBarVisibility`), clipboard and the find pasteboard (GPUI's), proxy (`http.proxy` and the system proxy via reqwest instead of NSURLSession), secrets (Secret Service, keyring), `code` CLI install (`~/.local/bin`), file watching (inotify, notify), the updater (a download link, as `update.mode` on a tar.gz), and the settings import paths (`~/.config/Code`, `~/.config/Cursor`, `~/.config/VSCodium`). Packaging: `port/tools/package-linux` writes `VSRustium-<version>-linux-<arch>.tar.gz`, the same folder as `VSRustium-<version>-linux-<arch>.AppImage` (`port/tools/linux/appimage`) and the `linux-<arch>.json` and `linux-<arch>-prerelease.json` feed entries (port/notes.md milestone 23); deb after it. Builds in a Linux container on the Studio (`docker`, linux/arm64) for the build and the unit tests; linux-x64 on a GitHub Actions `ubuntu` runner once arm64 is green. | `cargo build --release -p app` and the area tests pass on Linux arm64 and x64; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview under Xvfb and in a Wayland session (a headless compositor in the container); `v1.147.0-insider` carries `VSRustium-1.147.0-insider-linux-arm64.tar.gz` and `VSRustium-1.147.0-insider-linux-x64.tar.gz`; the macOS build is unchanged (its area tests and api-tests as before). |-| Milestones | M24 Windows build | in progress | Branch `worktree-m24-windows`, beside milestone 23 on the same seams: macOS and Linux code stays as it is, each Windows counterpart sits behind `cfg(target_os = "windows")` in the function where it is a few lines, in a `windows.rs` beside `macos.rs` and `linux.rs` where it is not. Scope: WebView2, the Win32 file dialogs and message boxes, the in-window menu bar and custom title bar, Credential Manager (keyring), named pipes for the extension host and single instance, ConPTY for the terminal (alacritty_terminal 0.25 has it), drive-letter paths and file URIs, the user-setup install path with `bin` on the user PATH (code.iss `addtopath`), `%APPDATA%\Code` settings import, an x64 and arm64 zip and a user installer, no Authenticode signing (the Windows signing decision). Cross build on the Studio (cargo-xwin, `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc`) for compile checks and host-run unit tests; real runs on GitHub Actions `windows` runners (`.github/workflows/windows.yml`, by hand). Seams: the "M24 Windows" rows. | `cargo build --release -p app` and the area tests pass on win32-x64 and win32-arm64 runners; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview on the runner; `v1.147.0-insider` carries `VSRustium-win32-x64-1.147.0-insider.zip`, `VSRustium-win32-arm64-1.147.0-insider.zip` and both user setups; the macOS and Linux builds are unchanged (their area tests as before). |+| Milestones | M24 Windows build | in progress | Branch `worktree-m24-windows`, beside milestone 23 on the same seams: macOS and Linux code stays as it is, each Windows counterpart sits behind `cfg(target_os = "windows")` in the function where it is a few lines, in a `windows.rs` beside `macos.rs` and `linux.rs` where it is not. Scope: WebView2, the Win32 file dialogs and message boxes, the in-window menu bar and custom title bar, Credential Manager (keyring), named pipes for the extension host and single instance, ConPTY for the terminal (terminal/pty/conpty.rs, the VT backend libghostty-vt is platform-neutral), drive-letter paths and file URIs, the user-setup install path with `bin` on the user PATH (code.iss `addtopath`), `%APPDATA%\Code` settings import, an x64 and arm64 zip and a user installer, no Authenticode signing (the Windows signing decision). Cross build on the Studio (cargo-xwin, `x86_64-pc-windows-msvc` and `aarch64-pc-windows-msvc`) for compile checks and host-run unit tests; real runs on GitHub Actions `windows` runners (`.github/workflows/windows.yml`, by hand). Seams: the "M24 Windows" rows. | `cargo build --release -p app` and the area tests pass on win32-x64 and win32-arm64 runners; the app opens a folder, edits, saves, runs an extension (the exthost handshake, emmet and git activate) and shows a webview on the runner; `v1.147.0-insider` carries `VSRustium-win32-x64-1.147.0-insider.zip`, `VSRustium-win32-arm64-1.147.0-insider.zip` and both user setups; the macOS and Linux builds are unchanged (their area tests as before). || Milestones | M25 virtual workspaces | later | Artur: its own milestone after M20, not part of the gap audits. A folder of a non-file scheme (`.code-workspace` `uri` folders, `--folder-uri`, `vscode.openFolder` with an extension file system provider scheme) kept as a URI; every reader of workspace folders (173 `.folders` uses in 70 files: explorer, search, quick open, terminal cwd, tasks, git, watcher, settings layers, trust) goes through the file system providers; the workspace marked virtual, `virtualWorkspaces: false` extensions disabled with the `notSupportedInWorkspace` message (config/workspace.rs:101, port/notes.md provider entries deferred until virtual workspaces). | not started || M23 Linux | app/src/webview/linux.rs:66 | done | [linux L] webviews through WebKitGTK: webview panels and views, editor insets, notebook outputs, extension details, release notes. | `FIXTURE=webview-tests port/tools/linux/smoke` on X11 (Xvfb): 10/10 ok; `cargo gc test -p app webview` on Linux: 19 passed || M23 Linux | app/src/webview/linux.rs:47 | open | [linux L] webviews in a Wayland session. Linux shows now: no webview under Wayland: GPUI has no X window there to hold the GTK window, so `supported()` is false and each webview surface stays empty. Needs a route that does not embed: GTK opens its own Wayland connection, and a `wl_subsurface` cannot take a surface of another client, so the reparenting X11 uses has no Wayland form; WPE WebKit rendering offscreen into a GPUI texture, with input forwarded, is the route left (not started). | |@@ -364,7 +364,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston| platform/state | src/vs/platform | M10 | verified | | storage/src/state.rs FileStorage (stateService.ts, immediate saves) with every state.test.ts case (cargo test -p storage state); User/globalStorage/storage.json keeps machineId, devDeviceId, the profiles and their associations || platform/storage | src/vs/platform | M10 | verified | | cargo test -p storage (storage.integrationTest.ts cases); port/tools/settings-check state: globalState and workspaceState survive a restart and the state.vscdb rows match the reference; the port keeps one Storage per scope (application = the default profile's, profile, workspace, shared for workspace trust) with synchronous writes, so storageService.test.ts's typed getters, StorageTarget and keys (Settings Sync, removed) and the change events between windows have no counterpart || platform/telemetry | src/vs/platform | M19 | verified | | product without enableTelemetry: supportsTelemetry false, NullTelemetryService, nothing sent (port/notes.md milestone 19); port/tools/privacy-check (Bun and Node, 5/5 each: isTelemetryEnabled false, TelemetryLogger never calls its sender, inert @vscode/extension-telemetry and vscode-tas-client); port/tools/telemetry-source-check |-| platform/terminal | src/vs/platform | M15 | verified | | terminal/pty.rs (node-pty), terminal.rs (process, environment, exit messages), terminal/profiles.rs, shell_integration.rs, prompt_input.rs, environment_collection.rs on libghostty-vt (native/crates/ghostty_vt, cargo test -p ghostty_vt); cargo test -p app terminal (105 tests) and the terminal api-tests (port/results/api-tests.md milestone 15: 47 passing, 0 failing); the pty host process layer is n/a (one process); terminal/pty.rs (node-pty), terminal.rs (process, environment, exit messages) on libghostty-vt (native/crates/ghostty_vt, cargo test -p ghostty_vt); cargo test -p app terminal |+| platform/terminal | src/vs/platform | M15 | verified | | terminal/pty.rs (node-pty), terminal.rs (process, environment, exit messages), terminal/profiles.rs, shell_integration.rs, prompt_input.rs, environment_collection.rs on libghostty-vt (native/crates/ghostty_vt, cargo test -p ghostty_vt); ui-pair port/fixtures/terminal/steps-backend.json dark against 1.148.0: SGR colors and attributes, wide and emoji cell widths, word selection and cursor match (under 0.4% of terminal pixels differ at 10% fuzz; the emoji glyph is drawn larger, a renderer difference); cargo test -p app terminal (105 tests) and the terminal api-tests (port/results/api-tests.md milestone 15: 47 passing, 0 failing); the pty host process layer is n/a (one process); terminal/pty.rs (node-pty), terminal.rs (process, environment, exit messages) on libghostty-vt (native/crates/ghostty_vt, cargo test -p ghostty_vt); cargo test -p app terminal || platform/test | src/vs/platform | M6 | n/a | | upstream test infrastructure; the port tests with cargo test and port/tools || platform/theme | src/vs/platform | M7 | verified | | registry defaults for dark, light, hcDark, hcLight with the color transforms (`transparent`, `withOpacity`, `darken`, `lighten`, `opaque`, `lessProminent`), `asCssVariableName` for webviews (theme.rs, webview.rs): every color the port resolves equals the reference workbench's `--vscode-*` variable in all 13 themes of port/fixtures/theme-colors (cargo test -p app theme::tests::resolved_colors_match_the_reference_workbench_variables); ids the port never paints stay unresolved; iconRegistry.ts and codicons.ts: every codicon and registered icon id draws the SVG of the code point codicon.css gives it, including codicons.ts's code point aliases (cargo test -p app codicons::tests::every_icon_id_draws_the_svg_of_its_code_point) || platform/tunnel | src/vs/platform | | removed | | no remote or tunnels by decision (port/notes.md); one local extension host |