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_tab_after_current | Opens a task tab immediately to the right of the active tab (Nash 0.4.0 or newer) |
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_tab_after_current,
new_window, split_horizontal, split_vertical):
- The
domainfield selects the spawn domain, not a separate GUI instance. It accepts"DefaultDomain","CurrentPaneDomain",{ DomainName = "name" }, or{ DomainId = 3 }. focusandkeepflags control post-spawn behavior (see below).
In Nash 0.11.9, new_tab appends at the end of the tab bar without
inheriting the active tab's custom color. Only new_tab_after_current inherits
that color and places the task tab immediately to the right of the active tab.
For server-owned tabs, that placement updates the server's shared tab order.
Since Nash 0.11.9, splitting a server-owned tab into a different domain is
rejected. Use the tab's own domain: leave domain omitted, set
domain = "CurrentPaneDomain", or explicitly name that same domain. To run in a
different domain, use a new tab or window instead of a split.
Focus & Keep Flags#
These flags only apply to spawned targets (new_tab, new_tab_after_current,
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.
On macOS and Linux, Nash 0.8.1 or newer returns a kept task to an
interactive shell even if a step fails or is interrupted. Later steps still stop
on failure; keep = true preserves the output, not continued execution. A task
that installs its own shell EXIT trap can replace Nash's keep wrapper. This
failure/interrupt shell wrapper is not implemented on Windows.
[[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.