Phoenix run in release, colours stripped from colourized output

Hi folks, I may have a rather unique problem. I’m working on a stub server which, among other things, validates stored stubs by diffing them against the current response from the real endpoint. The way I decided to show the diff was to send a plaintext response but colourized with ANSI codes using the IO.ANSI module. My problem is that the colours are missing when I run the server from an OTP release created using Distillery, https://github.com/yawaramin/stubbex/releases/tag/v0.0.1-beta . Colours show up in the response when run from the project source directory with mix phx.server or MIX_ENV=prod mix phx.server, just not when run from the release.

To reproduce:

  • Download and run the release as per the above link
  • Send a stub request to trigger storing a stub: curl localhost:4000/stubs/https/jsonplaceholder.typicode.com/todos/1
  • Send a validation request for the stored stub: curl localhost:4000/validations/https/jsonplaceholder.typicode.com/todos/1

Any ideas why this could be happening?

Hmm, actually this may be relevant … Unable to colorize escript text output … I’ll try it out soon.

1 Like