-
Notifications
You must be signed in to change notification settings - Fork 687
Description
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):
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:
- Create a new Aspire app host using the default template, or ensure your app host has no resources.
- Run
aspire run
. - Observe that no resources table is shown during execution.
- Press CTRL-C to stop the host.
- 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
(insrc/Aspire.Cli
) to check whether theIAsyncEnumerable
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!