+7
-3
lines changedFilter options
+7
-3
lines changed Original file line number Diff line number Diff line change
@@ -1262,7 +1262,7 @@ a semver. Like the \`rc\` in \`1.2.0-rc.8\`.
1262
1262
* Type: Boolean
1263
1263
1264
1264
When set to \`true\`, npm will display a progress bar during time intensive
1265
-
operations, if \`process.stderr\` is a TTY.
1265
+
operations, if \`process.stderr\` and \`process.stdout\` are a TTY.
1266
1266
1267
1267
Set to \`false\` to suppress the progress bar.
1268
1268
Original file line number Diff line number Diff line change
@@ -1549,13 +1549,16 @@ const definitions = {
1549
1549
type: Boolean,
1550
1550
description: `
1551
1551
When set to \`true\`, npm will display a progress bar during time
1552
-
intensive operations, if \`process.stderr\` is a TTY.
1552
+
intensive operations, if \`process.stderr\` and \`process.stdout\` are a TTY.
1553
1553
1554
1554
Set to \`false\` to suppress the progress bar.
1555
1555
`,
1556
1556
flatten (key, obj, flatOptions) {
1557
1557
flatOptions.progress = !obj.progress ? false
1558
-
: !!process.stderr.isTTY && process.env.TERM !== 'dumb'
1558
+
// progress is only written to stderr but we disable it unless stdout is a tty
1559
+
// also. This prevents the progress from appearing when piping output to another
1560
+
// command which doesn't break anything, but does look very odd to users.
1561
+
: !!process.stderr.isTTY && !!process.stdout.isTTY && process.env.TERM !== 'dumb'
1559
1562
},
1560
1563
}),
1561
1564
provenance: new Definition('provenance', {
Original file line number Diff line number Diff line change
@@ -396,6 +396,7 @@ t.test('color', t => {
396
396
t.test('progress', t => {
397
397
const setEnv = ({ tty, term } = {}) => mockGlobals(t, {
398
398
'process.stderr.isTTY': tty,
399
+
'process.stdout.isTTY': tty,
399
400
'process.env.TERM': term,
400
401
})
401
402
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4