You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My particular use case for concurrently is that I'm creating a Web Extension browser add-on in Typescript. I'm using concurrently to run the Typescript compiler and Mozilla's web-ext tool at the same time.
The web-ext utility has a weird little quirk in its logging (by design). To solve the request that repeated "reloaded" messages be rewritten rather than fill the console, mozilla/web-ext#617 added these lines:
This uses the \r carriage return to reset the cursor to the beginning of the line before the next log message is written. But this causes issues when using concurrently.
[web-ext] Applying config file: ./package.json
[web-ext] Running web extension from /home/user/code/project/extension
[web-ext] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[web-ext] Installed /home/user/code/project/extension as a temporary add-on
[web-ext] The extension will reload if any source file changes
Last extension reload: 01:24:15 GMT-0500 (CDT)^C
user@machine:~/code/project$ yarn watch exited with code SIGINT
--> Sending SIGTERM to other processes..
[web-ext] yarn start exited with code SIGINT
user@machine:~/code/project$
First, I tried moving the \r to the ending of the string in the web-ext code. That worked...
[web-ext] Applying config file: ./package.json
[web-ext] Running web extension from /home/user/code/project/extension
[web-ext] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[web-ext] Installed /home/user/code/project/extension as a temporary add-on
[web-ext] The extension will reload if any source file changes
[web-ext] Last extension reload: 02:12:56 GMT-0500 (CDT)
...but only the first time. As soon as tries to rewrite the line, we end up with a similar problem.
[web-ext] Applying config file: ./package.json
[web-ext] Running web extension from /home/user/code/project/extension
[web-ext] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[web-ext] Installed /home/user/code/project/extension as a temporary add-on
[web-ext] The extension will reload if any source file changes
^Cst extension reload: 02:14:45 GMT-0500 (CDT)0500 (CDT)
user@machine:~/code/project$ yarn watch exited with code SIGINT
--> Sending SIGTERM to other processes..
[web-ext] yarn start exited with code SIGINT
user@machine:~/code/project$
Next, I tried adding the carriage return to the blacklist of characters in concurrently's logger.
// #70 - replace some ANSI code that would impact clearing lines
text=text.replace(/\u2026/g,'...');
I changed it to:
text=text.replace(/(\u2026|\r)/g,'...');
This attempt got a little closer. It again works as desired the first time...
[web-ext] Applying config file: ./package.json
[web-ext] Running web extension from /home/user/code/project/extension
[web-ext] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[web-ext] Installed /home/user/code/project/extension as a temporary add-on
[web-ext] The extension will reload if any source file changes
[web-ext] ...Last extension reload: 02:25:09 GMT-0500 (CDT)
...but once again doesn't exactly work as desired once it prints the reload message multiple times.
[web-ext] Applying config file: ./package.json
[web-ext] Running web extension from /home/user/code/project/extension
[web-ext] Use --verbose or open Tools > Web Developer > Browser Console to see logging
[web-ext] Installed /home/user/code/project/extension as a temporary add-on
[web-ext] The extension will reload if any source file changes
[web-ext] ...Last extension reload: 02:25:09 GMT-0500 (CDT)...Last extension reload: 02:26:08 GMT-0500 (CDT)...Last extension reload: 02:26:10 GMT-0500 (CDT)...Last extension reload: 02:26:12 GMT-0500 (CDT)...Last extension reload: 02:26:13 GMT-0500 (CDT)...Last extension reload: 02:26:16 GMT-0500 (CDT)^C
user@machine:~/code/project$ yarn watch exited with code SIGINT
--> Sending SIGTERM to other processes..
[web-ext] yarn start exited with code SIGINT
user@machine:~/code/project$
I thought of specifically detecting strings beginning with \r and ending without a newline, but that seems too specific to my use case and would probably fail in other people's use cases. I'm not even entirely sure that concurrently should be the one that changes to handle this or if web-ext should change, but I'd be willing to bet there are other NodeJS command line apps out there that do similar line rewriting tricks.
The text was updated successfully, but these errors were encountered:
My particular use case for concurrently is that I'm creating a Web Extension browser add-on in Typescript. I'm using concurrently to run the Typescript compiler and Mozilla's web-ext tool at the same time.
The web-ext utility has a weird little quirk in its logging (by design). To solve the request that repeated "reloaded" messages be rewritten rather than fill the console, mozilla/web-ext#617 added these lines:
This uses the
\r
carriage return to reset the cursor to the beginning of the line before the next log message is written. But this causes issues when using concurrently.First, I tried moving the
\r
to the ending of the string in the web-ext code. That worked......but only the first time. As soon as tries to rewrite the line, we end up with a similar problem.
Next, I tried adding the carriage return to the blacklist of characters in concurrently's logger.
concurrently/src/logger.js
Lines 90 to 91 in a96b9cf
I changed it to:
This attempt got a little closer. It again works as desired the first time...
...but once again doesn't exactly work as desired once it prints the reload message multiple times.
I thought of specifically detecting strings beginning with
\r
and ending without a newline, but that seems too specific to my use case and would probably fail in other people's use cases. I'm not even entirely sure that concurrently should be the one that changes to handle this or if web-ext should change, but I'd be willing to bet there are other NodeJS command line apps out there that do similar line rewriting tricks.The text was updated successfully, but these errors were encountered: