Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pack should use the --no-color equivelant when its not attached to a terminal #486

Closed
zmackie opened this issue Jan 31, 2020 · 1 comment · Fixed by #1065
Closed

pack should use the --no-color equivelant when its not attached to a terminal #486

zmackie opened this issue Jan 31, 2020 · 1 comment · Fixed by #1065
Labels
status/ready Issue ready to be worked on. type/enhancement Issue that requests a new feature or improvement.

Comments

@zmackie
Copy link
Contributor

zmackie commented Jan 31, 2020

Summary


#477 turned up the fact that color escape codes are leaking into output when pack is not attached to a terminal. It would be UX nicety for pack to run as the equivelant to --no-color when, eg. piping to less.

note the output below is with pack built from #478 (therefore has the docker progress bar stripped)

Reproduction

Steps
± zm |fix-477 ✓| → ./out/pack build gcr.io/cncf-buildpacks-ci/pm/issues/pack:478-asdas --publish -p ../samples/apps/java-maven/ | morebionic: Pulling from cloudfoundry/cnb
dbe632be70ad: ESC[90mPulling fs layerESC[0m
750afeac99ff: ESC[90mPulling fs layerESC[0m
59bb86436456: ESC[90mPulling fs layerESC[0m
71cd62cf076a: ESC[90mPulling fs layerESC[0m
Expected

Cleaner output:

± zm |fix-477 ✓| → ./out/pack --no-color build gcr.io/cncf-buildpacks-ci/pm/issues/pack:478-asdas --publish -p ../samples/apps/java-maven/ | more
bionic: Pulling from cloudfoundry/cnb
dbe632be70ad: Pulling fs layer
750afeac99ff: Pulling fs layer
59bb86436456: Pulling fs layer
71cd62cf076a: Pulling fs layer
1473b2bc3374: Pulling fs layer
5d932446918a: Pulling fs layer
34e057da544e: Pulling fs layer
81d29541bb33: Pulling fs layer
ea92060a149b: Pulling fs layer
c995ce118c19: Pulling fs layer
17c50dd57945: Pulling fs layer
1de1a037cfdb: Pulling fs layer
68d2c99148bc: Pulling fs layer
e0bce984d18b: Pulling fs layer
c09e86e44715: Pulling fs layer
696fd8bb65f4: Pulling fs layer

Environment

pack info
± zm |fix-477 ✓| → ./out/pack report
Pack:
  Version:  dev-2020-01-31-11:18:55
  OS/Arch:  darwin/amd64

Default Lifecycle Version:  0.6.0

Config:
  default-builder-image = "cloudfoundry/cnb:bionic"
docker info
@zmackie zmackie added the type/bug Issue that reports an unexpected behaviour. label Jan 31, 2020
@jromero jromero added good first issue A good first issue to get started with. status/ready Issue ready to be worked on. type/enhancement Issue that requests a new feature or improvement. and removed type/bug Issue that reports an unexpected behaviour. labels Feb 4, 2020
@jromero
Copy link
Member

jromero commented Feb 4, 2020

Determining whether we are attached to the terminal seems to be pretty straight forward with use of terminal#IsTerminal().

@natalieparellano natalieparellano self-assigned this Feb 21, 2020
@natalieparellano natalieparellano removed their assignment Jun 3, 2020
@dfreilich dfreilich removed the good first issue A good first issue to get started with. label Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/ready Issue ready to be worked on. type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants