跳转到内容

Run configurations

此内容尚不支持你的语言。

A run configuration is a command line with its folder, environment, test report and the steps to run before it. Ferris IDEA suggests configurations from your build files, and keeps the ones you write in .ferris-idea/run.toml in the project, where you can commit them. Run configurations are Works; Run Anything is Experimental.

  • Run › Run Current File (⌃⇧R) runs what fits the caret: a main, a script, a test function or a whole test file. The language pages list the commands per language, for example Rust.
  • The ▶ in the gutter does the same for one line.
  • Run › Run… (⌃⌥R) opens the list of configurations.

Each start opens a tab in the Run tool window (⌘4). The first line is the command line, error output is shown in the error colour, and the run ends with “Process finished with exit code n”. Modified files are saved before every start.

Run › Run… and Run › Debug… (⌃⌥D) open the same list, also reachable from the run widget at the top of the window:

Heading What it holds
Pinned the configurations you pinned
Run Configurations the ones in run.toml, grouped by their folder
Temporary the last five things you ran without saving them
Detected from build files the suggestions from Cargo, npm, Go, Maven, Gradle and pytest

Type to filter; 1 to 9 pick a row and 0 opens Edit Configurations…. Hold ⇧ to debug instead of run. The ⋮ menu of a row offers Edit…, Delete, Pin, Save Configuration for a temporary one and Copy to run.toml for a detected one.

  1. Run › Edit Configurations…. The dialog “Run/Debug Configurations” opens.

  2. Add (⌘N) and choose a type: Command, Shell script, Node.js file, npm script, Python file, Cargo, Maven, Gradle, Go test or pytest.

  3. Fill in the form:

    Field Meaning
    Name unique in the project
    Command line one line, quoted as in a shell; nothing is expanded except ${workspace} and ${env:NAME}
    Working directory inside the project; empty means the project folder
    Environment one NAME=value per line
    Kind Run, or Test to read a report into the result tree
    Report format and file for tests: junit, libtest, tap, jest (also Vitest) or gotest
    Timeout seconds until the run is stopped; 600 unless you change it
    Folder a group in the run list
    Instances One at a time, or Allow multiple instances
  4. Under Before launch, add configurations to run first, and tasks: Build, Run external tool… or Open browser….

  5. Apply writes run.toml and keeps its comments; Run and Debug start it at once.

Problems show under the field they belong to while you type. Edit templates per type… sets the defaults a new configuration of that type starts with, including the interpreter for Python and Node.js. In a project you have not trusted the dialog only shows.

[[run]]
name = "tides"
command = ["python3", "tidepool/tides.py", "--days", "7"]
env = { TIDE_STATION = "harbour" }
before = ["fetch readings"]
[[run]]
name = "fetch readings"
command = ["sh", "scripts/fetch.sh"]
timeout = 120

A configuration from IntelliJ IDEA’s project files (.idea/runConfigurations, workspace.xml, .ipr) of the types Application, JUnit, Gradle, Maven, Python, Shell Script and HTTP request is listed and run as it is; it is read only, and one in run.toml with the same name hides it.

The order is: the configurations named under Before launch, then Build (Maven, Gradle, Cargo, Go or the package’s build script), then external tools. Open browser… opens an http(s) address or a project .html file once the program has started, and can wait up to 60 seconds for a local port. When a step fails, the chain stops with “Run stopped: step failed”.

  • In the Run tool window: Rerun (⌘R) and Stop (⌘F2). Stop ends the whole process group, first politely, after three seconds by force.
  • Starting a configuration that is still running asks Stop and Rerun or Cancel, unless it allows multiple instances; then the new run gets its own tab, “name (2)”.
  • Send EOF (⌘D in the Run tool window) closes the program’s input.
  • The ⋮ menu of the Run tool window has Copy Command Line and Open Run Configuration.

The Run console keeps the last 10,000 lines. It does not turn file names in the output into links and shows no ANSI colours; the debug console does follow Java and Python stack traces.

Press ⌃ twice. Type a command line and press ↩: it runs in the project folder as a temporary configuration. The list also offers your run configurations and the last 20 commands. The command is split as a shell would split it, but nothing is expanded; use a Shell script configuration for pipes and variables. In a remote project Run Anything runs typed commands on this machine only, so it refuses them there; use the Terminal tool window.

  • No compound configurations that start several at once.
  • No coverage run; see Run tests.
Keyboard of
ActionShortcut
RerunRerun⌘RCtrlF5
Run⌘4Alt4
Run › Debug⌃⌥DAltShiftF9
Run › Debug⌃DShiftF9
Run › Debug Current File⌃⇧Dno shortcut
Run › Run⌃⌥RAltShiftF10
Run › Run⌃RShiftF10
Run › Run Current File⌃⇧RCtrlShiftF10
Run › Stop⌘F2CtrlF2
Run anythingRunAnything⌃then⌃CtrlthenCtrl
Send eofSendEOF⌘DCtrlD

Listing needs no right. Running needs the right run and a trusted project; editing run.toml also needs write. Each tool does a dry run unless the agent asks otherwise, and every real run is written to the agent log. You grant rights per workspace.

  • build_projectchangesdry run by defaultruntrusted-projectBuild Project in one call: the window's Build Project chain (Before Build tasks, cargo, Maven, Gradle and Go builds, After Build tasks), stopping at the first failure.
  • project_modelreadsProject model read from the build files in the workspace (Cargo, npm, Python, Maven, Go; Gradle detected): modules with name, version, folder, toolchain, dependencies with scope, tasks and members; problems per build file; suggested run configurations (Python ones with the workspace's selected interpreter, ${workspace}/… inside the workspace).
  • run_commandchangesdry run by defaultruntrusted-projectRun one program with arguments in the workspace (no shell).
  • run_configurationchangesdry run by defaultruntrusted-projectRun a configuration from .ferris-idea/run.toml, or a reference IDE configuration that idea_project lists (untranslated ones are refused with the reason), after its before-launch chain.
  • run_configuration_editchangesdry run by defaultrunwritetrusted-projectChange the run configurations of .ferris-idea/run.toml with the Edit Configurations dialog's validation.
  • run_configurationsreadsRun configurations of .ferris-idea/run.toml (configs) with their validation problems, plus folders, types (what Add offers), templates and template_problems.
  • run_markersreadsdry run by defaultThe run markers (gutter ▶) of a file with 1-based line and the run configuration each starts: Java/Kotlin main and JUnit tests (single method via Maven or Gradle), Vitest/Jest describe/it/test, pytest, Go and Rust tests, and the main of Go programs, Rust binaries and examples, and Python scripts (kind main).
  • run_outputreadsThe Run tool window of the running Ferris IDEA window, read only: its tabs (name, running, exit code of the last run, number of failed tests); with tab (configuration name) also its console text and failed tests (name, message, details), masked (secrets as ‹masked›, count in masked) and cut to the attachment budget keeping head and tail.