fix(cli): Ensure newline to prevent error output boxen misalignment #9135
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.
Problem
When invoking a ctrl+c the boxen error output is misaligned.
Fix
Just print a newline before the boxen encased error output.
Future
@dac09 - This at least solves the misalignment. It doesn't address the issue with the error showing when it's not really appropriate. I think that might be more appropriately dealt with by directly try-catching the execa call where it is called.
I have tried on all three platforms:
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'e:'
so I can't really debug further until I address that.I'll take a further attempt at debugging this cross platform exit code stuff when I'm a little more familiar with mac. One thing to note is that @jtoar and I already had a similar issue where execa/storybook itself behaved differently on mac, windows & ubuntu so we might be a little at the whims of our dependencies with this.
TLDR - Boxen output fixed. Excessive error output I'll fix in a future PR because it'll be a more carefully thought out change.