Watch Aspire live streamsDocsTry Aspire

TerminalService

Classsealednet10.0
📦 Aspire.Hosting v13.6.0
Manages terminals created and owned by the AppHost.
namespace Aspire.Hosting.ApplicationModel;
public sealed class TerminalService
: System.IAsyncDisposable
{
// ...
}
IAsyncDisposable

Two experiences share this service: terminals displayed by IInteractionService.PromptTerminalAsync and terminals shown as tabs in the dashboard's terminal dock. They differ only in TerminalPlacement; the lifetime, transport, and automation machinery is identical.

This is distinct from the terminal host, which exists solely to surface terminals for DCP-owned processes. Those are owned by the resource, reachable over a Unix domain socket, and are not tracked here.

Resolve it from the built AppHost's service provider: app.Services.GetRequiredService<TerminalService>(). Only creation and lookup are public; the members the dashboard uses to attach transports and watch the dock's tab list are internal, because they are transport plumbing rather than something an AppHost author calls.

Each dashboard metadata watcher buffers up to 64 updates by default. Set ASPIRE_TERMINAL_WATCH_BUFFER_CAPACITY to a positive integer in the AppHost's configuration before starting the application to tune this limit. Overflow replaces queued changes with a current snapshot while preserving the latest pending request to show the dock.

View all methods