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

Backslashes in output from yarn fail when they match standard escape sequences in Windows #5517

Closed
zhulika opened this issue Mar 14, 2018 · 1 comment

Comments

@zhulika
Copy link

zhulika commented Mar 14, 2018

The error reporting seems to have an escaping issue with folder names that start with 'n' on Windows. For example, when printing an error from the yarn start command, it outputs the directory :

Directory: C:\root\name

as:

Directory: C:\\root\\
ame

This is on Windows 10 and with yarn v1.5.1

@BYK
Copy link
Member

BYK commented May 3, 2018

Relevant code:

// should match all literal line breaks and
// "u001b" that follow an odd number of backslashes and convert them to ESC
// we do this because the JSON.stringify process has escaped these characters
return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|[\\]n/g, os.EOL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants