Targets & Execution Domains#

The target and domain fields control where and how your task executes.

Target Values#

TargetDescription
current_paneRuns the task in the currently active pane
new_tabOpens a new tab for the task
new_tab_after_currentOpens a task tab immediately to the right of the active tab (Nash 0.4.0 or newer)
new_windowOpens a new window for the task
split_horizontalSplits the current pane horizontally and runs the task in the new pane
split_verticalSplits the current pane vertically and runs the task in the new pane

Default Behavior#

The interaction between target and domain follows these rules:

ConditionEffective Target
Both omittedcurrent_pane
target omitted, domain presentnew_tab
target present, domain omittedCurrentPaneDomain
Both presentUses 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 shell override is not applied — the task runs in the active pane's current shell
  • If cwd is 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 domain field selects the spawn domain, not a separate GUI instance. It accepts "DefaultDomain", "CurrentPaneDomain", { DomainName = "name" }, or { DomainId = 3 }.
  • focus and keep flags 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.

FlagDefaultBehavior
focustrueThe new tab/window/pane takes focus immediately
keepfalseThe 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.