Repository navigation
Description
Feature description
Users may desire to interact directly with resources. E.g. Aspire dashboard might want to have a terminal emulator that one could attach to a container-based-, or process-based resource and interact directly with it. Or an MCP server with stdio interface might be part of Aspire workload and one would need to access its stdio streams to use it.
Design outline and constraints
- Both Executable and Container resource get a flag that enables "attaching to stdio" (stdin + stdout + stderr). When this flag is present, we capture and memorize standard file descriptors for a given resource as it is started.
Consider if we could enable attaching to
stdiofor all Executables and Containers - Executable and Container API objects get a
stdiosubresource. When that subresource is queried, we create and return paths to 3 Unix domain sockets that are attached to relevant resource file descriptors. We also start a proxy that will push data between these sockets and resource file descriptors.These paths could also be simply status properties of Executable and Container objects.
- Standard output and standard error streams are captured and stored in (raw) temporary files from the moment a resource (with
AttachToStdio == true) is started. They are also forwarded to the log writer so the existing log streams continue to work forAttachToStdio == trueresources. - When a new client connects to stdout or stderr socket, the existing content is replayed to it.
- If more than one client connects to stdin socket, bad things might happen 😄
Additional notes
Sébastien Ros (@sebastienros) has created a proof-of-concept https://github.com/microsoft/usvc-apiserver/tree/sebros/stdin The details are different from the design outline above, but it illustrates the potential.
Activity
karolz-ms commentedon Jan 5, 2026
The above will only work for the standard (process) execution mode. We need to enhance the IDE protocol explicitly to enable this for the IDE execution mode (and not all IDE's/program types will support it).
karolz-ms commentedon Jan 5, 2026
Design update from discussion with Mitch Denny (@mitchdenny) Sébastien Ros (@sebastienros) and David Negstad (@danegsta)
Executables and Containers will have I/O 3 modes, requested via spec property:
Regular mode (only console logs available, no
stdinaccess) -- default, the current behavior.Simple I/O mode -- DCP creates a Unix domain socket for I/O. Incoming bytes are written to
stdin; combined output fromstdoutandstderris written back to the socket. No support for terminal resizing.Full terminal mode -- when launching Executable or Container, DCP allocates a pseudo-terminal for it (pseudo-console on Windows). The object specification contains a path to Unix domain socket that will serve as the terminal connection for the Executable/Container. Terminal resizing is supported via proprietary enhancement to the input data stream.
karolz-ms commentedon Jan 5, 2026
Promising, cross-platform library for handling pseudo-terminals in Go: https://github.com/aymanbagabas/go-pty?tab=readme-ov-file
WithTerminal Phase 4: wire per-replica TerminalSpec into DCP Executab…
WithTerminal Phase 4: wire per-replica TerminalSpec into DCP Executab…
WithTerminal Phase 4: wire per-replica TerminalSpec into DCP Executab…
WithTerminal Phase 4: wire per-replica TerminalSpec into DCP Executab…
WithTerminal Phase 4: wire per-replica TerminalSpec into DCP Executab…
WithTerminal(): per-replica interactive terminal sessions (Aspire sid…