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_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_window, split_horizontal, split_vertical):

  • The domain field determines which nash instance handles the spawned execution
  • focus and keep flags 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.

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.

[[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.