Return to less intrusive way of starting server in a new window on macOS #2715
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2696. Reverts #2628.
Summary
A change was made in #2628 to work around a bug in Ghostty by forcing a new process to open in the default terminal app by adding the following option to the macOS
opencommand:-n Open a new instance of the application(s) even if one is already running.This means that, in iTerm at least (and likely others), an entirely new dock icon will appear, which prevents switching between existing iTerm windows and this new one using the typical
cmd+~keyboard shortcut.Furthermore, iTerm has overrides that allow you to open in a tab instead of a window when the command is
open -a, but it can't do anything to override openopen -nabecause of the fact that it launches an entirely separate process, not just window. (Side note: I would love to understand the rationale behind the fact that metro insists on launching in a new window instead of letting the terminal app in use decide how to handle it per the user's preferences, but I digress).This removes the
-nflag as the Ghostty bug that it added to work around has been verified fixed and released in Ghostty 1.2.0, out todayTest Plan
This reverts to longtime behavior for the CLI when launching the metro server process in a terminal. However, I have tested it with the following, and all seems to behave as expected:
REACT_TERMINAL=iTerm yarn iosREACT_TERMINAL=Ghostty yarn ios(using Ghostty 1.2.0)REACT_TERMINAL=Terminal yarn ioscc @Kamefrede for additional testing
Checklist
react-nativecheckout (instructions).