# Layout
croft is a three pane workspace in the VS Code arrangement: an Explorer sidebar, a code editor, and a terminal, with an activity bar down the far left. This is the full pane-by-pane reference; the [README](../README.md#layout) keeps the high-level summary.
## Panes
* **Left pane (sidebar):** Explorer with multi-select, cut / copy / paste, drag-and-drop moves, and VS Code style icons. Git-ignored files and folders render their names in a dimmed grey (VS Code's ignored-resource decoration); a fully ignored folder dims along with everything under it, and the shading follows `.gitignore` edits via the same debounced refresh that feeds the status bar. A `⋯` "Views and More Actions" button on the EXPLORER title line opens a menu that toggles which sub-views stack in the panel, mirroring VS Code: **Open Editors** (the open tabs, with dirty dots and click-to-activate), **Folders** (the file tree), **Outline**, **Timeline**, and **Dependencies**. The toggles persist across launches (Open Editors hidden by default, the rest shown). The **OUTLINE** section is the active editor's symbol tree (functions, classes, fields, etc.), indented by nesting with kind icons, that highlights the symbol the caret is in and jumps the editor to a symbol on click; it paints instantly from tree-sitter on file open and is refined by the language server's richer symbols when they arrive, so it never waits on a cold server. **TIMELINE** lists the active file's git history (`git log --follow`); clicking a commit opens its diff for that file. **DEPENDENCIES** is language-aware: it detects the workspace root's package manifest(s) and lists their packages, labeling the header for what it found (Cargo.toml → "RUST DEPENDENCIES" from `cargo metadata`, pyproject.toml/requirements.txt → "PYTHON DEPENDENCIES", package.json → "NODE DEPENDENCIES", go.mod → "GO DEPENDENCIES"). It mirrors how rust-analyzer's view only exists in a Rust project: a folder with no recognized manifest shows no dependency view at all and drops it from the ⋯ menu. Each section is individually collapsible, grows to at most half the region, and scrolls independently under the mouse wheel; the file tree absorbs the leftover rows. OUTLINE and TIMELINE start collapsed to their header chevron until expanded (matching VS Code), so they claim no rows from the tree on a fresh launch. Search and a Remote (SSH) explorer swap in via the activity bar.
* **Activity bar:** the icon strip down the far left. View icons (Explorer, Search, Source Control, Remote, Run and Debug, Extensions, Testing) at the top, a settings gear at the bottom whose Color Theme picker switches between Croft Black (`#000000`, default), Croft Dark (Blue) (`#1e222e`), and ten editor-inspired dark themes (One Dark Pro, Dracula, Monokai, Nord, Gruvbox Dark, Tokyo Night, Catppuccin Mocha, Solarized Dark, GitHub Dark, Darcula), persisted in `~/.config/croft/config.json`. Themes are data: the built-ins ship as a baked-in `[[themes]]` manifest (listed in the Extensions panel as "Color Themes"), and dropping another theme manifest into `~/.config/croft/extensions/` adds it to the picker with no rebuild. The Source Control icon carries a count badge over its corner whenever the working tree has changes, the Explorer icon carries one for the number of unsaved open files, the Remote icon carries one for the number of ports forwarded home over SSH, and the Testing icon carries a red one for the number of failing tests.
* **Top right pane (editor):** code editor with tree-sitter syntax highlighting, an LSP semantic-token overlay, and inline preview tabs for images, PDFs, and spreadsheets. Splits side by side with `Cmd`+`\`, with an optional native vim modal mode on `Cmd`+`E`. The usual VS Code editing commands are built in: move / copy lines, multi-cursor, toggle line and block comments, join lines, sort lines, transform case, trim trailing whitespace, and toggle word wrap.
* **Bottom right pane (panel group):** a VS Code-style tab strip (**PROBLEMS**, **OUTPUT**, **TERMINAL**, **CAPTURES**, **PORTS**) over a shared region; the active tab's label is underlined like VS Code's tab indicator. **PROBLEMS** is the aggregated workspace diagnostics view: every file with a language-server diagnostic becomes a collapsible group (file icon, name, relative directory, and a count), and under it one row per diagnostic with a severity glyph, the message, and the source server. The tab carries an orange count badge of all diagnostics. Click a file header to collapse / expand it; click a diagnostic to open that file and jump the editor to the line, and a toolbar filters by severity and toggles grouping by file versus a flat list. **OUTPUT** is a read-only log viewer modelled on VS Code's Output panel: a toolbar with a channel dropdown, a minimum-level filter, an RPC trace toggle, and a clear action, over the selected channel's level-coloured tail (auto-following new lines until you scroll up). Channels appear as producers log: one per language server (its `window/logMessage`, `showMessage`, and stderr), plus **Debug Adapter**, **Git** (the exact git commands the Source Control panel runs), and **Server Provisioning** (managed language-server downloads). The RPC toggle traces raw JSON-RPC per server into a `<server> (trace)` channel (Zed's RPC-messages equivalent), off by default. **TERMINAL** is a real interactive shell, your `$SHELL` on a real PTY (splittable into side-by-side panes). While the PROBLEMS or OUTPUT tab is focused the arrow / page keys scroll the list and `Esc` returns focus to the editor; the mouse wheel scrolls it from anywhere. **CAPTURES** collects output lines matched by `capture` triggers — compiler errors, test failures — each entry jumping its pane back to the line on click. **PORTS** lists loopback ports croft detects from terminal output and a periodic socket poll; on a remote session a detected port forwards home over the live SSH connection and opens in your local browser, and Cmd/Ctrl+click on a printed `http://localhost:PORT` does the same inline.
* **Secondary side bar:** an optional auxiliary column on the edge *opposite* the primary side bar, hosting the active file's **Outline**. Toggle it with `Opt`+`Cmd`/`Ctrl`+`B` or from the Customize Layout popup.
* All three panes resize by dragging the seams between them, including the seam between the two editor columns when the editor is split.
## Customize Layout
The `⛶` icon at the top-right of the editor (and the welcome screen), or the settings gear → **Customize Layout**, opens a popup that mirrors VS Code's title-bar layout controls. Two icons beside it toggle the primary side bar (`▢`) and the panel (`▭`) directly. The popup groups: visibility toggles (Activity Bar, Primary Side Bar, Secondary Side Bar, Panel, Status Bar), **Primary Side Bar Position** (Left/Right — the activity bar moves with it), **Panel Alignment** (Left/Center/Right/Justify, where Justify spans the panel across the full content width under the side bar), **Quick Input Position** (Top/Center, for the Command Palette / Go to File), and **Zen Mode** (`Cmd`/`Ctrl`+`K` `Z`, which hides all chrome and restores it on the next toggle). Every choice except the frequently-toggled side-bar / panel visibility persists in `~/.config/croft/config.json`.
## Command Palette
`Cmd`/`Ctrl`+`Shift`+`P` fuzzy-searches and runs every named command, the same surface VS Code uses to make actions reachable without memorising a chord. Go to Symbol (`Cmd`/`Ctrl`+`Shift`+`O`) fuzzy-jumps within a file (or to a line with a `:` prefix), and a `#` prefix in Quick Open searches symbols across the whole workspace through the language servers.
## Editor
The editor brings tree-sitter highlighting, inline previews for images / PDFs / spreadsheets, side-by-side splits, a minimap (a rasterized file preview in a right-edge strip; click or drag to jump, right-click to toggle or re-side it), a breadcrumbs bar (the file path plus the enclosing symbol trail at the caret, click to jump), sticky scroll (the enclosing scope headers pinned to the top while you scroll), bracket-match highlighting, multi-cursor editing (`Cmd`/`Ctrl`+`D` for the next match, `Option`+click for a caret, `Shift`+`Option`+drag for a column selection), a git gutter (thin coloured bars marking lines added, modified, or deleted against HEAD), GitLens-style inline blame (a dim annotation trailing the cursor's line with the author, age, and commit summary; toggle from the Command Palette), merge-conflict resolution (conflict blocks tint green / blue like VS Code and `Cmd`/`Ctrl`+`.` offers Accept Current / Incoming / Both), code folding (collapse any indented block to its header line from a gutter chevron or `Cmd`/`Ctrl`+`K` chords), in-file find and replace (`Cmd`/`Ctrl`+`F` to find, `Cmd`+`Opt`+`F` / `Ctrl`+`Alt`+`F` to replace, with regex capture references), undo and redo (`Cmd`/`Ctrl`+`Z` and `Shift`+`Cmd`/`Ctrl`+`Z`; typing bursts coalesce into one step, and a fresh edit after an undo discards the redo branch), format on save (toggle with `Cmd`/`Ctrl`+`K` `F`), auto save (VS Code's afterDelay: dirty buffers write themselves a second after the last edit; toggle from the Command Palette), an optional vim mode, and full LSP (completion, signature help / parameter hints, hover, go-to-definition, rename, formatting, quick fixes / code actions, diagnostics, and inlay hints — inferred types and parameter names spliced inline as dim italic annotations, on by default like VS Code; toggle with **Editor: Toggle Inlay Hints**).
Markdown files get a rendered preview on `Cmd`/`Ctrl`+`Shift`+`V` (VS Code's chord): headings, emphasis, lists, task checkboxes, quotes, aligned tables, links, and fenced code blocks coloured by the editor's own tree-sitter highlighters, reflowing with the pane and following your edits.
Make it yours: rebind any command in `keybindings.json`, define `Tab`-expandable snippets (with tab stops and placeholders) in `snippets.json`, and flip settings from a searchable **Preferences: Open Settings** hub — all under `~/.config/croft/` and reachable from the Command Palette.
## Terminal
The TERMINAL tab is your `$SHELL` on a real PTY, splittable into side-by-side panes.
* **Shell integration:** OSC 133 shell integration auto-installs for zsh, bash 4.4+, and fish, so `Cmd`/`Ctrl`+`Opt`+`Up`/`Down` jumps between command prompts. Every finished command gets a VS Code-style gutter dot on the pane border (blue for success, red for failure); click it for the exit code, runtime, and a menu to copy or select that command's output or re-run it. Long commands finishing in an unfocused pane announce themselves, new splits inherit the shell's exact cwd, and OSC 9 notifications surface in the status bar.
* **Find:** `Cmd`/`Ctrl`+`F` searches the pane's screen and scrollback with every hit highlighted.
* **Quick select:** `Ctrl+Shift+Space` opens WezTerm-style quick select, labelling every URL, path, hash, and IP on screen so two keystrokes copy one (UPPERCASE pastes it into the shell).
* **Copy mode:** `Ctrl+Shift+Y` enters copy mode, where vi keys walk the scrollback and `v`/`V`/`Ctrl+V` select by character, line, or rectangular block before `y` copies.
* **Command history:** `Ctrl+Shift+H` searches a durable command history — every command run under croft, with its directory, exit code, and duration, kept across restarts, filterable to the current directory or failures only, `Enter` typing the pick back at your prompt.
* **Triggers:** iTerm2-style triggers from `triggers.json` watch the output stream and highlight matches in your colours, post status-bar notices, or capture matching lines into the CAPTURES tab where one click jumps back to the line.
* **Broadcast:** `Cmd`/`Ctrl`+`K` `I` broadcasts your typing to every pane at once for multi-server work, behind a confirm popup and with red `⇶` pills marking the receiving panes.
* **Inline images:** `imgcat` pictures render inline at their output row.
* **Progress:** a program reporting OSC `9;4` progress (systemd, winget, cargo wrappers) turns the pane's bottom border into a live gauge — blue advancing, red frozen on error, yellow paused, a sweeping segment while indeterminate — with the percent echoed in the pane's name pill.
* **Scrollback:** `Shift+PageUp`/`PageDown` page the scrollback (depth configurable), scrolling deep into output pins the producing command to the pane's top row, a palette toggle shows each row's arrival time down the right edge, and clicking the prompt line moves the shell cursor there. `Cmd`/`Ctrl`+`K` `D` opens the pane's whole scrollback in an editor tab, and `Cmd`/`Ctrl`+`K` `N` pins a note to selected output (amber-underlined, click to read).
* **Panes:** pane colors follow the theme's own ANSI palette so output looks identical in every host terminal. Drag a pane's name pill to reorder panes, and a `⛶` button or `Cmd`/`Ctrl`+`K` `M` maximizes one pane across the panel while the rest wait in a right-edge rail you can shuffle through or drag into a new order. A closed pane stays undoable for 10s (`Cmd`/`Ctrl`+`K` `Shift+T` brings it back, process intact), and the whole pane layout — directories, names, focus — is saved per workspace and restored on the next launch. `host_accents` rules in config.json dress panes on matching hosts — production shells get a red border, warning pill, and badge watermark.
* **Selections:** text selections stay glued to their text: through streaming output, through your scrolling, and even inside full-screen apps that scroll by repainting (Claude Code, pagers), where the highlight follows the app's own scrolling, keeps its surviving rows lit while the app's chrome covers the block's edge, hides only when the text is fully off the app's view (copy still yields the whole selection), and comes back with it. `Shift`+click extends a selection, and a drag held past the pane edge keeps selecting — through scrollback at a shell, or by scrolling the app itself when it owns the wheel.
* **Jump to source:** Cmd/Ctrl+click on any printed `path:line` reference (a compiler error, a test failure, a grep hit, a traceback) jumps the editor straight there, no problem-matcher config, and the Command Palette's **Terminal: Search & Replace from Last grep/rg** turns the `grep`/`rg` you just ran in a pane into the Search sidebar's results, ready to replace across every match.
## Source Control
Source Control mirrors VS Code's git flow: stage, unstage, and discard per file or in bulk, commit / amend / push / pull / sync, branches, stashes, and tags, with clickable change rows opening a side-by-side diff against HEAD. Inside that diff, single keys act on the change hunk under the cursor: `S` stages just that hunk, `U` unstages it, and `R` reverts it after a confirm, so one messy working tree becomes several focused commits without leaving the editor. Below the change list, a **COMMITS** section draws the repo-wide commit graph (VS Code's built-in Source Control Graph, in the tig / lazygit idiom): colour-cycled box-drawing rails trace every branch and merge across local branches and tags, each row showing its ref badges (HEAD's branch bold, tags gold), subject, and age; clicking a commit opens its full patch — header, message, diffstat, diff — in a read-only editor tab, and the graph refreshes itself whenever HEAD moves.
## Local history
Local history guards every save: croft snapshots each file as you write it, and the Explorer's TIMELINE lists those snapshots next to the git commits (VS Code's Timeline model) so you can diff any past version against the working file or restore it, even versions you never committed.
## Testing
A **Testing** view (the beaker icon, or `Cmd`/`Ctrl`+`K` `B`) mirrors VS Code's Test Explorer: it discovers the project's tests on first open — `cargo test` for Rust, `pytest` for Python, `vitest` or `jest` for JS/TS (detected from package.json) — and lists them as a suite tree with live pass/fail/skip glyphs (each runner is a built-in extension, so switching one off in the Extensions panel stops its projects being detected). Each row's play glyph runs that test or suite (a green ▷ also marks test functions in the editor gutter, click it to run), clicking a test's name jumps to its source, Enter runs everything, `Cmd`/`Ctrl`+`K` `Enter` runs the test under the editor caret, and the beaker icon wears a red badge counting failures.
## Tasks
A task runner with zero configuration: `Cmd`/`Ctrl`+`Shift`+`B` runs the project's build task, auto-detected from the manifests the repo already has (Makefile, justfile, package.json with the right lockfile runner, Cargo.toml, pyproject.toml, and `.vscode/tasks.json` when present). "Tasks: Run Task" in the palette lists everything discovered; each task runs in its own named terminal pane, and rerunning reuses that pane.
## Status bar
The status bar mirrors VS Code's: branch and ahead/behind, error/warning counts (click to open Problems) and the active language server on the left; cursor position, indentation, encoding, line ending, and language mode on the right. Click the indentation, encoding, line ending, or language segment to change it: the indentation pill opens VS Code's Select Indentation menu (Indent Using Spaces / Tabs, change the tab size, or convert the buffer's existing indentation), and the rest reopen with a different encoding, switch LF/CRLF, or override the language mode.
## Debugging
* **Debug Python with breakpoints:** set breakpoints in the editor gutter (`F9`), press `F5`, and croft launches the file under debugpy over the Debug Adapter Protocol so it stops on the red lines — step over (`F10`), step into (`F11`), step out (`Shift+F11`), resume (`F5`), pause a running program (`F6`), stop (`Shift+F5`). When paused, the Run and Debug panel shows the call stack and an expandable variables tree, a debug console of program output with a `❯` REPL that evaluates in the selected frame, and hovering a variable in the editor shows its value. Conditional breakpoints (a red `◆`) and break-on-exceptions are in the Command Palette; breakpoints the adapter can't bind show hollow (`○`). Requires CPython 3.14+ (croft provisions a private debugpy venv on first use); no fallback to older interpreters. Rust / C / C++ files route to `lldb-dap` through the same machinery.
* **Or attach to a running Python process:** the Command Palette's "Debug: Attach to Python Process" lists live CPython 3.14+ processes and drops a `pdb` REPL into the one you pick (PEP 768 `sys.remote_exec`, no restart, no instrumentation). Because croft owns a real PTY, the debugger and any `sudo` password prompt run right in a terminal pane, instead of the half-managed console a GUI editor falls back to.
## Language servers
The editor speaks LSP for completion, hover, go-to-definition / references / implementations, rename, document formatting (`Cmd`+`Opt`+`Shift`+`F`), quick fixes / code actions (`Cmd`+`.`: auto-import, fix-all, organize imports, and refactors, picked from a menu and applied as one undo step, with `codeAction/resolve` for servers that defer the edit), and diagnostics, each anchored at the file's own project root so monorepo sub-projects resolve correctly. For Python it runs Astral's `ty` as the primary server, with `basedpyright` as a fallback for the few capabilities `ty` does not yet advertise and `ruff` for lint; for TypeScript / JavaScript it runs `vtsls`; for YAML it runs `yaml-language-server`; for JSON / HTML / CSS it runs the VS Code servers (`vscode-json-language-server`, `vscode-html-language-server`, `vscode-css-language-server`); for Bash it runs `bash-language-server`; for TOML it runs `taplo`; for C / C++ it runs `clangd`. croft provisions `vtsls`, `yaml-language-server`, the JSON / HTML / CSS servers, and `bash-language-server` (via npm) and `ty` / `ruff` (via uv, or `pkg` on Termux) for itself on first use; `taplo`, `clangd`, and `rust-analyzer` ship as prebuilt binaries, so croft downloads the right release for your platform into `~/.croft/servers` (a toolchain copy on PATH or in `~/.cargo/bin` always wins, and on Termux `rust-analyzer` comes from `pkg` since the glibc release can't run on bionic). It also picks up `basedpyright` and `gopls` from your PATH if present.