Treat dumb terminals as noninteractive#5237
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5237 +/- ##
=======================================
Coverage 61.18% 61.18%
=======================================
Files 202 202
Lines 6765 6765
Branches 3 4 +1
=======================================
Hits 4139 4139
Misses 2625 2625
Partials 1 1
Continue to review full report at Codecov.
|
| import isCI from 'is-ci'; | ||
|
|
||
| export default process.stdout.isTTY && !isCI; | ||
| export default process.stdout.isTTY && process.env.TERM !== 'dumb' && !isCI; |
There was a problem hiding this comment.
Feels like there should exist some module which has this logic already
There was a problem hiding this comment.
I had the same feeling, but I couldn't find one that specifically checks for a dumb terminal without doing other stuff. For example supports-color takes into account if a terminal is dumb but it's coupled with color related features that we don't want to check in this case.
|
Thanks for submitting a well detailed issues and PR to Jest to fix an issue you were running into! |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #5236 and related issues outside of Emacs. Essentially, the issue is that
isInteractiveonly checksprocess.stdin.isTTYand CI environment variables, but it should treat a shell withTERMset todumbas noninteractive even if is has a TTY (not all TTYs support interactive escape codes). Note that while Emacs' Compilation mode supports interactive comint processes with a prefix argument, it is still not supported with this Jest patch (for examplejest --watchwill ignore input).Test plan
yarn test packages/jest-util/src/__tests__/is_interactive.test.jspassesyarn linkandjestin another project in Emacs successfully hides mode escape codes (though is an extra�[999Dright after the lastPASSline that I can't figure out how to remove, I'd appreciate feedback)