Skip to content

Metro open in new window instead of tab #2696

@LaGregance

Description

@LaGregance

Describe the Feature

On MacOS with iTerm, on the previous version of the CLI, Metro opened in a new tab instead of a new window.
I don't know if I'm alone in this situation, but I found it extremely painful to have so many windows open.

Possible Implementations

After investigation, this is due to a little change in @react-native-community/cli-tools/build/startServerInNewWindow.js:103:

// Old version
return _execa().default.sync('open', ['-a', terminal, launchPackagerScript], procConfig);

// New version
return _execa().default.sync('open', ['-na', terminal, launchPackagerScript], procConfig);

The last version have -na option instead of -a when running launchPackager.command that force the new window.

If other people are facing the same problem, we may consider putting an environment variable to override these flags, like REACT_LAUNCHPACKAGER_OPTIONS="-a".
For the moment I use patch-package to fix it on my repo.

What do you think about this proposal ?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions