Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't show child process spinner #526

Closed
tjx666 opened this issue Mar 1, 2023 · 1 comment
Closed

doesn't show child process spinner #526

tjx666 opened this issue Mar 1, 2023 · 1 comment

Comments

@tjx666
Copy link

tjx666 commented Mar 1, 2023

if I run npx i18n pull --workspaces in zsh, will show spinner:

image

but using following code will not:

export async function execWithOutput(command: string, cwd?: string) {
    const subprocess = execaCommand(command, {
        cwd,
        shell: true,
        stdin: 'inherit',
        env: { FORCE_COLOR: 'true' },
    });
    subprocess.stdout?.pipe(process.stdout);
    subprocess.stderr?.pipe(process.stderr);
    await subprocess;
    return subprocess;
}

execWithOutput('npx i18n pull --workspaces')

image

  System:
    OS: macOS 13.2.1
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 381.21 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  npmPackages:
    execa: ^7.0.0 => 7.0.0 
@ehmicky
Copy link
Collaborator

ehmicky commented Mar 1, 2023

Hi @tjx666,

Thanks for reaching out, but it seems like this issue might be more related to how process execution works in general, as opposed to Execa itself.

In particular, this might be related to the TTY being non-interactive, due to using pipe() instead of stdout: 'inherit' or stderr: 'inherit'. Many spinner libraries are disabled by default when they detect that stdout or stderr is running in a not interactive TTY (such as in a CI).

However, this is not related to Execa itself, as you'd experience the same issue using child_process.spawn() directly.

Also, we would need a GitHub repository to reproduce this specific issue, since this involves a few implied dependencies and setup.

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants