Skip to content

[BUG] Generator enters interactive mode and gets suspended in non-TTY environments #1987

@sahillllllllll-bit

Description

@sahillllllllll-bit

Describe the bug.

When running the generator in a non-interactive environment (e.g., background process, CI, or with redirected stdin), it still initializes interactive UI components such as the spinner and prompts.

This causes the process to be suspended by the shell instead of completing execution.

The generator does not properly detect and disable interactive behavior when process.stdout.isTTY === false.

This affects CI pipelines and automation environments.

Expected behavior

When running in a non-interactive environment (e.g., CI, background process, or with redirected stdin/stdout):

  • The generator should automatically detect that process.stdout.isTTY === false.
  • Interactive UI components (spinners, prompts) should be disabled.
  • The command should execute in non-interactive mode.
  • The process should complete normally without being suspended or blocked.
  • Output should be plain and automation-friendly.

Screenshots

Image

How to Reproduce

1. Create a valid AsyncAPI file

Create a file named asyncapi.yaml:

asyncapi: '2.6.0'
info:
  title: Non TTY Test
  version: '1.0.0'
channels: {}

2. Run the generator in background (non-TTY mode)

asyncapi generate fromTemplate asyncapi.yaml @asyncapi/html-template -o out &
wait

3. Observe the behavior

Instead of completing normally, the shell shows:

[1]+  Stopped  asyncapi generate ...

🖥️ Device Information [optional]

  • Operating System (OS):Windows WSL
  • Browser:
  • Browser Version:

👀 Have you checked for similar open issues?

  • I checked and didn't find similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue ?

Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions