Skip to content

Commit

Permalink
Merge pull request #9513 from webpack/bugfix/terminal-length
Browse files Browse the repository at this point in the history
make status logging 1 char shorter
  • Loading branch information
sokra committed Aug 2, 2019
2 parents ff8946e + 8006117 commit 1d98dad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/node/nodeConsole.js
Expand Up @@ -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}`);
Expand Down
2 changes: 1 addition & 1 deletion test/ProgressPlugin.test.js
Expand Up @@ -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());
Expand Down

0 comments on commit 1d98dad

Please sign in to comment.