Skip to content

Malformed Table Output in aspire run Command #9497

@mitchdenny

Description

@mitchdenny

Thank you for clarifying! Here’s a further refined issue draft that reflects the technical detail: the table is based on an IAsyncEnumerable of resource states, not a collection held in memory.


Title: Malformed Table Output on CTRL-C When No Resources are Present in aspire run

Description:

When running aspire run with a freshly created Aspire app host (such as one generated from the Aspire template, or any configuration where no resources are present), the CLI does not display a resources table during execution. However, after pressing CTRL-C to stop the host, a malformed (empty) table appears in the terminal (see screenshot):

image1

Root Cause Detail:

  • The table output is based on an IAsyncEnumerable of resource states. When there are no resources, this enumerable yields no results, leading to a table render with no rows and broken borders after CTRL-C.

Steps to Reproduce:

  1. Create a new Aspire app host using the default template, or ensure your app host has no resources.
  2. Run aspire run.
  3. Observe that no resources table is shown during execution.
  4. Press CTRL-C to stop the host.
  5. Observe the malformed/empty table that appears.

Expected Behavior:

  • If there are no resources (i.e., the IAsyncEnumerable yields no results), the CLI should show a clear message such as "No resources are present." both during execution and after stopping.
  • The table should not be rendered if it would contain no rows.

Actual Behavior:

  • No table is rendered while running.
  • After CTRL-C, a malformed/empty table is rendered, which is confusing to the user.

Proposed Fix:

  • Update the logic in RunCommand (in src/Aspire.Cli) to check whether the IAsyncEnumerable of resource states yields any results before rendering the table.
  • If no resource states are produced, display a friendly message (e.g., "No resources are present.") instead of rendering an empty table, both during execution and after stopping.
  • Continue to display the existing CTRL-C message for clarity.

Additional Context:

  • This scenario commonly occurs with new projects from the Aspire template, but could happen in any project with no resources.
  • The malformed table only appears after pressing CTRL-C, not during normal execution.

Let me know if you want this further tailored or ready for pasting into a GitHub issue!

Metadata

Metadata

Assignees

Labels

area-clineeds-area-labelAn area label is needed to ensure this gets routed to the appropriate area owners

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions