question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

it would be good to disable coloring if process runes from TeamCity. Here is node -p 'process.env' output from TeamCity build step:

{ TEAMCITY_BUILD_PROPERTIES_FILE: ‘/opt/teamcity/buildagetnt/temp/buildTmp/teamcity.build2602458914988989541.properties’, TERM: ‘linux’, JRE_17_x64: ‘/usr/lib/jvm/jre’, TMPDIR: ‘/opt/teamcity/buildagetnt/temp/buildTmp’, TEAMCITY_CAPTURE_ENV: ‘“/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.85.x86_64/jre/bin/java” -jar “/opt/teamcity/buildagetnt/plugins/environment-fetcher/bin/env-fetcher.jar”’, TEAMCITY_VERSION: ‘9.0.5 (build 32523)’, JRE_HOME: ‘/usr/bin/…’, TEMP: ‘/opt/teamcity/buildagetnt/temp/buildTmp’, TEAMCITY_BUILDCONF_NAME: ‘api api’, BUILD_VCS_NUMBER: ‘95fb89fd9d28’, NLSPATH: ‘/usr/dt/lib/nls/msg/%L/%N.cat’, PATH: ‘/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/lib’, RUNLEVEL: ‘3’, runlevel: ‘3’, _: ‘/usr/bin/node’, PWD: ‘/opt/teamcity/buildagetnt/work/abeaf100e9e82338’, LANGSH_SOURCED: ‘1’, DOCKER_CONFIG: ‘/usr/local/etc/.docker’, TEAMCITY_GIT_PATH: ‘/usr/bin/git’, LANG: ‘en_US.UTF-8’, PREVLEVEL: ‘N’, previous: ‘N’, XFILESEARCHPATH: ‘/usr/dt/app-defaults/%L/Dt’, CONSOLETYPE: ‘serial’, BUILD_VCS_NUMBER_feedbackforum_feedbackforumapi: ‘95fb89fd9d28’, HOME: ‘/root/’, SHLVL: ‘4’, TEAMCITY_PROCESS_FLOW_ID: ‘818047604373’, UPSTART_INSTANCE: ‘’, TMP: ‘/opt/teamcity/buildagetnt/temp/buildTmp’, UPSTART_EVENTS: ‘runlevel’, BUILD_NUMBER: ‘150’, JRE_17: ‘/usr/lib/jvm/jre’, UPSTART_JOB: ‘rc’, TEAMCITY_PROJECT_NAME: ‘10 tests’, COMPOSER_HOME: ‘/usr/local/bin’, TEAMCITY_PROCESS_PARENT_FLOW_ID: ‘’ }

In similar situation xUnit runner uses TEAMCITY_PROJECT_NAME env variable to detect that it running from TeamCity

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sindresorhuscommented, May 19, 2016

@Qix- It’s a CI. I don’t see why we can’t handle situations like this gracefully.

0reactions
sindresorhuscommented, May 22, 2016

@Qix- In a perfect world, yes. I used to think that way too, but in reality they never do and you always just end up having to implement workarounds in every module…

This should cover most of them though: https://github.com/chalk/supports-color/commit/9170da93dde30a88040b388176628b482bf64515

Read more comments on GitHub >

github_iconTop Results From Across the Web

TeamCity Monitoring and Diagnostics - JetBrains
This tab provides a number of indicators helping you to detect and address issues with the TeamCity server performance. CPU & Memory Usage....
Read more >
How to detect if a Gradle build is running on TeamCity?
This property can be used to determine if the build is run within TeamCity. To do it in a Gradle script, method java.lang.System#getenv(java....
Read more >
Getting Test Results in TeamCity - xUnit
The runners in xUnit.net detect TeamCity is running through environment variables (specifically, it looks for TEAMCITY_PROJECT_NAME ).
Read more >
TeamCity - GitVersion
GitVersion requires the presence of main branch in order to determine the version number. If TeamCity uses https to clone git repos then...
Read more >
MetaDefender TeamCity Plugin - OPSWAT
With the MetaDefender plugin you can quickly scan your build with 30+ leading anti-malware engines, not only to detect possible malware, but also...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found