nushell / nushell/nushell

`job send` doesn't collect

Open
#18,416 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status:needs-triage
Dominant language
Rust
Stars
40.5k
Forks
2.3k
Avg merge
1d 19h
Merged PRs (30d)
85

Description

Bug report form
  • I have done a basic search of the issue tracker to find any existing issues that are similar.
  • I have checked that my version is at least the latest stable release available via my installation method.
Describe the bug

When using job send with output piped from external commands, the output is not collected (See discord #help channel discussion). As a result, if used in an each closure, all external command entries will run simultaneously instead of in parallel.

How to reproduce
  1. Verify each loop runs in series with built-in commands:
    def long_command [] {
      sleep 1sec
      return "output"
    }
    job spawn {
      1..5 | each {
        long_command | job send 0
      }
    }
    loop {
      job recv | print
    }
    
  2. Verify each external command loop runs in series outside job spawn:
    1..5 | each {
      bash -c 'sleep 1s; echo "output"' | print
    }
    
  3. Add a job spawn closure with associated job send 0 and job recv and see all entries in the each loop are run in parallel:
    job spawn {
      1..5 | each {
        bash -c 'sleep 1s; echo "output"' | job send 0
      }
    }
    loop {
      job recv | print
    }
    
  4. Confirm this does not happen when the output is instead piped into a second each loop or into collect:
    job spawn {
      1..5 | each {
        bash -c 'sleep 1s; echo "output"'
      } | each {
        job send 0
      }
    }; loop {
      job recv | print
    }
    
    job spawn {
      1..5 | each {
        bash -c 'sleep 1s; echo "output"' | collect | job send 0
      }
    }
    loop {
      job recv | print
    }
    
Expected behavior

Piping the output of an external command directly into job send while in an each loop should still cause the command to run to completion before the next item is started.

Configuration

~> version | transpose key value | to md --pretty

key value
version 0.113.1
major 0
minor 113
patch 1
branch makepkg
commit_hash 7b7df4aa68e957cf38b9d8157c35fa7523f44a6d
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.95.0 (59807616e 2026-04-14) (Arch Linux rust 1:1.95.0-1)
cargo_version cargo 1.95.0 (f2d3ce0bd 2026-03-21) (Arch Linux rust 1:1.95.0-1)
build_time 2026-05-30 01:36:30 +00:00
build_rust_channel release
allocator standard
features default, mcp, network, plugin, rustls-tls, sqlite, trash-support
installed_plugins polars 0.108.0, skim 0.25.0
experimental_options example=false, reorder-cell-paths=true, pipefail=true, enforce-runtime-annotations=true, native-clip=true, cell-path-types=true

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the provided job spawn, job send, job recv, each, and collect examples, then trace the job send path for output from external commands. Done means a direct pipe into job send waits for each external command to finish, matching the built-in-command behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.