Merge pull request #9513 from webpack/bugfix/terminal-length
make status logging 1 char shorter
This commit is contained in:
commit
1d98daddab
|
@ -40,7 +40,9 @@ const clearStatusMessage = () => {
|
|||
const writeStatusMessage = () => {
|
||||
if (!currentStatusMessage) return;
|
||||
const l = process.stderr.columns;
|
||||
const args = l ? truncateArgs(currentStatusMessage, l) : currentStatusMessage;
|
||||
const args = l
|
||||
? truncateArgs(currentStatusMessage, l - 1)
|
||||
: currentStatusMessage;
|
||||
const str = args.join(" ");
|
||||
const coloredStr = `\u001b[1m${str}\u001b[39m\u001b[22m`;
|
||||
process.stderr.write(`\x1b[2K\r${coloredStr}`);
|
||||
|
|
|
@ -29,7 +29,7 @@ describe("ProgressPlugin", function() {
|
|||
|
||||
it("should not print lines longer than stderr.columns", () => {
|
||||
const compiler = createSimpleCompiler();
|
||||
process.stderr.columns = 30;
|
||||
process.stderr.columns = 31;
|
||||
|
||||
return RunCompilerAsync(compiler).then(() => {
|
||||
const logs = getLogs(stderr.toString());
|
||||
|
|
Loading…
Reference in New Issue