Skip to main content
gboudrea
May 5, 2022 12:44 PM UTC
Question

CLI 2: op run removes colors, ignores terminal size

ls outputs colors, and uses multiple columns:

But using op run, it doesn't:


1Password Version: CLI 2.1.0
Extension Version: Not Provided
OS Version: macOS

14 replies

XIII
May 6, 2022 12:31 PM UTC

What happens if you add --no-masking to op run?

gboudrea
gboudreaAuthor
May 6, 2022 12:32 PM UTC

Then the result shows in columns, but no colors.

May 11, 2022 9:30 AM UTC

Hey @gboudrea, thank you for reaching out to us!
I think the problem here is that ls detects op run to not be a terminal-type output, which is why colours are disabled by default (since the default setting for the --color flag is auto).
Easiest way to fix this would be to include the --color flag in your command, i.e. op run -- ls --color.
Please do let us know if this helps.

Best,
Horia

gboudrea
gboudreaAuthor
May 11, 2022 10:14 AM UTC

Indeed, that fixes it.
I also noticed other commands (heroku, terraform) correctly detect that colors can be used with op run, and will use color with no additions in the command : i.e. op run --no-masking -- heroku will output colors.

Thanks.

May 11, 2022 10:35 AM UTC

Great! Let us know if we can help with anything else.

Jul 7, 2022 11:36 AM UTC

I'm having the same problem.
I would really prefer having the output masked, but removing the colours from for instance compile output makes it hard to find errors.

Jul 11, 2022 8:45 AM UTC

Hey Rotendahl,

We currently have a ticket tracking this very problem internally. Although not our top focus, we will try to prioritise it between our development cycles. We'll keep the thread updated with any progress on this!

Best,
Horia

Oct 30, 2022 12:25 AM UTC

+1

Feb 28, 2023 4:41 PM UTC

Hi @"Horia.Culea_1P", has there been any progress? I am also using op run with a tool where I'd really appreciate coloured output.

seanboult
Mar 6, 2023 2:18 PM UTC

Looking for this feature as well and here is example of where both programs seem to need to handle this.

Pass a color flag to watch and npm and that seems to let watch handle colors correctly, maybe the CLI needs something similar?
watch --color npm start --color always

So I'd imagine we'd want 1password CLI to support a --color flag.