Targets & Execution Domains
The target and domain fields control where and how your task executes.
Target Values
| Target | Description |
|---|---|
current_pane | Runs the task in the currently active pane |
new_tab | Opens a new tab for the task |
new_window | Opens a new window for the task |
split_horizontal | Splits the current pane horizontally and runs the task in the new pane |
split_vertical | Splits the current pane vertically and runs the task in the new pane |
Default Behavior
The interaction between target and domain follows these rules:
| Condition | Effective Target |
|---|---|
| Both omitted | current_pane |
target omitted, domain present | new_tab |
target present, domain omitted | CurrentPaneDomain |
| Both present | Uses both as specified |
Current Pane Details
When target = "current_pane":
- Nash sends the task command text directly into the active pane
- No new pane, tab, or window is spawned
- The top-level
shelloverride is not applied — the task runs in the active pane's current shell - If
cwdis specified, nash runs the task in a scoped shell block and returns to the original directory afterward
Spawned Targets
For targets that create new UI elements (new_tab, new_window, split_horizontal, split_vertical):
- The
domainfield determines which nash instance handles the spawned execution focusandkeepflags control post-spawn behavior (see below)
Focus & Keep Flags
These flags only apply to spawned targets (new_tab, new_window, split_horizontal, split_vertical). They are ignored for current_pane.
| Flag | Default | Behavior |
|---|---|---|
focus | true | The new tab/window/pane takes focus immediately |
keep | false | The tab/window/pane closes automatically when the command finishes |
Setting focus = false restores focus to the previously active pane after starting the task. Setting keep = true holds the spawned tab/window/pane open so you can inspect the output.
[[task]] id = "watch-logs" title = "Watch Logs" target = "split_horizontal" focus = false keep = true command = "tail -f /var/log/app.log"
This task opens a horizontal split that stays visible after the command starts, without stealing focus from your current work.
Continue to Scope & Overrides to learn how global and project-level tasks merge.