Tasks and terminal
Axiom runs build, check, restore, run and test commands as tasks, and opens an interactive terminal on request. Both run code the workspace controls, so both need workspace trust. Neither starts on its own: opening a folder runs nothing. Design: ADR 0018.
Where tasks come from
| Source | Command | Output parsing |
|---|---|---|
Language provider (Rust's Cargo, .NET's dotnet and Python's interpreter tasks) | Resolved by the provider when the task starts: program, arguments, folder, environment | The provider's parser: diagnostics and test results |
| Custom command (Tasks panel, + Command…) | A program (a name on PATH or a path) and arguments, one per line | None: raw output only |
Run Build Task and Run Test Task choose the task of the innermost discovered project that contains the active file, so a folder with Rust, C# and Python projects builds the one you are editing; without an active file in a project they use the first configured task.
The user can adjust either kind: extra arguments (provider tasks), the working folder (relative to the workspace) and environment variables. Values marked secret are hidden in the editor and never logged, shown or shared. Task settings last for the session.
Running a task
- No shell. The program and each argument are passed to the operating system as they are.
$HOME,;,|, quotes and*reach the program unchanged. - Checks before start:
- the folder must exist inside the workspace;
- a relative program path must stay inside the workspace;
- a bare name is looked up only in the absolute entries of
PATH(the task's ownPATHif it sets one); - environment names and values are validated;
- trust is checked when the task is queued and again just before the process starts.
- Environment. The inherited environment minus variables whose names look like secrets (process supervision), plus the task's own variables. Build tools need their toolchain variables (
CARGO_HOME,DOTNET_ROOT, …), which the language-server allowlist would drop. - Ownership. Each task runs under the process supervisor, which owns its whole process tree. Cancel asks the tree to stop and kills it after 2 s. Revoking trust or opening another folder kills it at once. Quitting kills every task.
- Results come only from output. The exit code is shown as such. Diagnostics and test results exist only if the provider's parser read them; a line that looked like a result but could not be read is listed as unreadable. A panic in a parser loses that line's results, not the run.
- Paths are checked. A reported file is opened only if it resolves inside the workspace. Others are listed but not navigable.
Limits
| Limit | Default | When exceeded |
|---|---|---|
| Tasks running at once | 2 | Others wait in the queue |
| Tasks waiting | 8 | New runs are refused with a message |
| Output kept per stream (stdout, stderr) | 1 MiB, newest | Older bytes are dropped; the view starts with "[… N earlier bytes were dropped …]" |
| Output drawn in the panel | 200 KiB | The panel shows the end |
| Line length given to the parser | 8 KiB | The rest of the line is cut |
| Diagnostics and test results per run | 2,000 | Counted as "not kept" |
| Finished runs kept | 20 | Oldest dropped |
| Environment variables per task | 64 | Refused when saving |
Toolchain check
Before a provider task is queued, Ide::toolchain_status asks the language's toolchain provider whether the tool is there (using the task's own PATH if it sets one). When it is missing, or global.json asks for an SDK that is not installed, the task is refused with setup guidance and nothing runs. The Tasks panel shows the same line for the selected task.
Build artifacts
A provider's parser can report executables the tool built (Cargo's compiler-artifact messages, MSBuild's Name -> path lines). Each run keeps up to 100, newest last. Ide::debug_launch_plan(run, target, args) turns one into a debugger launch plan through the language's debug provider. The path is always the tool's own report; Axiom never guesses where a build put its output.
For AI
Ide::task_result_snapshot gives the AI host a read-only summary of a run: the task, its source (provider or custom command), the workspace, the result, problems, failed tests and the last 4 KiB of each stream with secret-looking text redacted. Arguments and environment values are never included. It is requested through the AI host like any other context, so the sharing permission applies.
The AI host can also ask for the project graph (ContextRequest::Projects): each discovered project with its targets, including test targets, and its tasks. It holds names and relative paths only, never file contents.
Terminal
Run → New Terminal (Ctrl+Shift+) opens your shell ($SHELL, else /bin/sh; %ComSpec%on Windows) in the workspace folder, in a real pseudo-terminal: Unix PTYs or Windows ConPTY throughportable-pty, decoded by the vt100` terminal emulator.
- Needs workspace trust; refused in restricted folders. At most 4 at once.
- The shell inherits your environment, as in any terminal. It is your shell, started by you; the AI cannot type into it.
- Keys are sent the way xterm sends them. While the terminal has focus, plain Ctrl+letter shortcuts (Ctrl+C, Ctrl+R, Ctrl+P, …) go to the shell; shortcuts with Shift or Alt, function keys and Ctrl+digit still reach Axiom. Ctrl+1 returns to the editor.
- Scrollback keeps 5,000 lines. One input (such as a paste) can be at most 64 KiB, and at most 64 inputs wait while the program is not reading.
- Closing a terminal, revoking trust, opening another folder or quitting kills the shell and hangs up its session, which ends its foreground job.
A job you start in the background (command &, nohup) is not in the shell's foreground group and can outlive the terminal, as with any terminal emulator. Tasks do not have this problem: their whole process tree is owned.
If the system cannot provide a pseudo-terminal, the panel says so instead of opening a fake one.