Skip to content

CLI crashes in Spectre.Console.LiveRenderable over Remote SSH without a TTY #19290

Description

@ivnmood

Bug description

aspire run crashes while rendering resource state when it is launched through VS Code Remote SSH without a real TTY. The AppHost and dashboard start successfully, but the CLI exits while updating the live resource list.

Environment

  • Aspire CLI: 13.4.6
  • .NET SDK: 10.0.302
  • OS: Linux (kernel 6.8)
  • Launch context: VS Code Remote SSH
  • SSH_CONNECTION is set
  • VSCODE_IPC_HOOK_CLI is set
  • TERM=dumb
  • stdout/stderr are not TTYs and the terminal height is reported as zero

Reproduction

Run an AppHost with a larger resource graph from a Remote SSH/non-TTY session:

pnpm start
# equivalent to:
aspire run --project <AppHost-project>.csproj

The AppHost builds, the dashboard begins listening, and resource state processing starts. Then the CLI exits with code 2:

System.ArgumentException: Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
   at System.Collections.Generic.List`1.RemoveRange(Int32, Int32)
   at Spectre.Console.LiveRenderable.<Render>d__25.MoveNext()
   at Spectre.Console.Rendering.RenderableExtensions.GetSegments(...)
   at Spectre.Console.LegacyConsoleBackend.Write(IRenderable)
   at Spectre.Console.LiveDisplayContext.Refresh()
   at Spectre.Console.LiveDisplayContext.UpdateTarget(IRenderable)
   at Aspire.Cli.Commands.RunCommand.ProcessResourceState(...)

Expected behavior

The CLI should avoid live rendering when stdout is not a usable TTY, or otherwise render resource state without throwing. The AppHost should remain running after the dashboard becomes available.

Workarounds verified

  • Running the same command in a real PTY works.
  • env -u VSCODE_IPC_HOOK_CLI pnpm start works as a one-command workaround.
  • The direct .NET AppHost fallback works.
  • Setting CI=1 or only setting COLUMNS/LINES does not fix it because those do not create a real TTY.

This appears related to non-interactive Spectre rendering issues discussed in #17410, #15203, #13875, #18010, and #12134, but I could not find an exact duplicate for this exception and Remote SSH environment.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions