Comments (5)
👍 Also seeing messy output
from concurrently.
I rewrote the logWithPrefix
function to have a cleaner output (almost the same as without concurrently).
Basically, you need to have lastChar
variable available outside of the function so you know if you are a at the beginning of a new line or not. This covers most of the edge cases when the stdout
moves the cursor or delete characters.
var lastChar;
function logWithPrefix(prefix, prefixColor, text, color) {
if (config.raw) {
process.stdout.write(text);
return;
}
text = text.replace(/\u2026/g,'...'); // Ellipsis
var lines = text.split('\n');
// Do not bgColor trailing space
var coloredPrefix = colorText(prefix.replace(/ $/, ''), prefixColor) + ' ';
var paddedLines = _.map(lines, function(line, index) {
var coloredLine = color ? colorText(line, color) : line;
if (index !== 0 && index !== (lines.length - 1)) {
coloredLine = coloredPrefix + coloredLine;
}
return coloredLine;
});
if (!lastChar || lastChar == '\n' ){
process.stdout.write(coloredPrefix);
}
lastChar = text[text.length - 1];
process.stdout.write(paddedLines.join('\n'));
}
from concurrently.
Has this been fixed, perhaps by the move to node v4? I'm running the latest version of concurrently
on node v4.4.5 and don't experience this.
@kimmobrunfeldt @elliottsj what commands were you running? Just wondering if I can repro
from concurrently.
Sorry, didnt link the PR. Here it is #70
I included a repo and command lines to reproduce.
from concurrently.
Sorry for the delay on releasing this, folks! Check v3.5.1 🚢
from concurrently.
Related Issues (20)
- Command `node` not run in Windows (PowerShell and Cmd) HOT 4
- Suppress current task being outputted in terminal before it runs HOT 2
- Build failed when using concurently HOT 17
- `--kill-others-on-fail` flag not working as expected with `--group --max-processes 1` HOT 5
- Filter for output of specific commands HOT 4
- Installing package from npm takes a long time HOT 4
- No colors for prefixes when using `prefixColors: "auto"` via concurrent API HOT 3
- How to combine with other node command HOT 1
- CLI options not clear in README HOT 1
- Installing package from npm cnpm yarn takes a long time HOT 2
- Logs of the commands running are not readable HOT 2
- Cancel a series of tasks with SIGINT HOT 5
- Feature Suggestion with wildcards HOT 1
- Error TS2349 using concurrently in full ESM module HOT 1
- Programmatically restarting Command using `kill/start` API produce wrong termination HOT 5
- Allow commands IPC HOT 4
- Feature request: Add or document API option to disable color output
- Prefix ([0] [1]) randomly missing HOT 1
- How to distinguish which process the output stream line comes from HOT 1
- No commands recognized when using via API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from concurrently.