Issue #2198: Pipes, redirections and && as a structure, not a shell text: a list of commands with their arguments and where each stream goes

Open and answer this issue on GitHub.

note, safety · opened 2026-11-19 · updated 2026-11-19 · 0 comments

Follows from “Decision: which shell process::shell runs on Windows” (#1937), owner, 2026-11-19, ADR-raw-sinks-1 D9 item 3.

Goal

What a program wants a shell for (a pipe a | b, a redirection > file, && / ||, a glob) is given later as a structure: a list of commands, each a program with its arguments, and where each stream goes. A value from outside is always one argument, so nothing is escaped and nothing has to be proved. It runs without a shell, the same on every platform. A sketch of the shape, not decided:

use std::process

let out = process::pipe([process::cmd("convert", [name, "-resize", "64x64", "-"]),
                         process::cmd("gzip", [])];
                        stdout: process::to_file("thumb.png.gz"))

A library that does hand a text to sh or cmd.exe is the shell library ADR-raw-sinks-1 keeps the untrusted-shell key for (D4, D5): its escaping is its own, and the application allows it.

Open before it can be ready

Status note until a program needs it; then it becomes a decision with a decision paper.

Back to Open Issues