Configuration

Editors

Choose what testlane code opens a workspace in, from a preset like zed or nvim to a command of your own.

testlane <project> <ref> code opens a workspace in your editor, so you can go from a branch name to reading its code in one command. You pick the editor once, with a preset name or a command of your own, and Testlane works out how to launch it and whether to wait for it.

At a glance

AspectEditors
Where to set iteditor in the project file, then editor in defaults.toml
Defaultcode, which opens Visual Studio Code
For one run--editor <preset or template> on code
Presetszed, code, cursor, windsurf, idea, webstorm, phpstorm, goland, vim, nvim, helix, hx and terminal
Your ownAny other string, run with bash -c, with {path} for the workspace
WaitingTerminal editors keep code in the foreground, and the rest return at once
Check itcode --dry-run prints what it would launch, and testlane doctor checks a preset is installed

Pick an editor

Set editor in a project file, or in defaults.toml for every project that doesn't set its own:

~/.testlane/my-project.toml
editor = "zed"

Without either, Testlane opens code. To use another editor for one run, pass --editor:

testlane my-project 42 code --editor vim

Presets

A preset is an editor Testlane already knows how to launch, so you only need its name:

PresetWhat Testlane runsDoes code wait?
zedzed <path>No
codecode --new-window <path>No
cursorcursor --new-window <path>No
windsurfwindsurf <path>No
idea, webstorm, phpstorm, goland<name> <path>No
vim, nvim, helix, hx<name> <path>Yes
terminalYour $SHELL, or bash, in the workspaceYes

Graphical editors start in the background, so code returns straight away. Terminal editors and terminal keep the foreground until you quit them.

testlane doctor checks that a preset's program is on your PATH, and warns when it isn't, so you find out before the first code fails.

Templates of your own

Any editor that isn't a preset name is a template: a command Testlane runs with bash -c. Put {path} where the workspace's path goes, and Testlane quotes it for the shell:

~/.testlane/my-project.toml
editor = "emacsclient -n {path}"

All the template variables work here, not only {path}. Testlane doesn't check that a template has {path}, so one without it opens your editor without the workspace.

Wait for the editor

A template starts in the background, so code returns straight away. End it with :wait to keep code in the foreground until the editor exits, which you'll want when code is one step of a script:

~/.testlane/my-project.toml
editor = "kak {path}:wait"

:wait works only at the end of a template. Presets wait or not as the table above shows.

Check what would launch

--dry-run prints the command code would run, after the steps that create the workspace, and opens nothing:

testlane my-project feat/login code --dry-run --editor 'emacsclient -n {path}'
mkdir -p /home/you/dev/testlane/my-project/trees
git -C /home/you/dev/testlane/my-project/repo fetch --no-tags origin --end-of-options feat/login
git -C /home/you/dev/testlane/my-project/repo worktree add /home/you/dev/testlane/my-project/trees/feat-login -B feat/login --track origin/feat/login
mkdir -p /home/you/dev/testlane/my-project/trees/.data/feat-login
bash -c 'emacsclient -n /home/you/dev/testlane/my-project/trees/feat-login'

code doesn't take --json, since it opens a program rather than printing a result. Asking for both stops with E_USAGE and exit 2.

Copyright © 2026