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

seanboult
Mar 6, 2023 2:22 PM UTC

Wait maybe it's really only the downstream program needing support cause this seems to work for me.

Jack_P_1P
1Password Employee
1Password Employee
Mar 6, 2023 11:03 PM UTC

Hi @lukany:

We don't have anything to share just yet, so please keep an eye out for updates.

@seanboult:

That's exactly right, support for the --color flag will depend on the program you're running. 1Password CLI masking secrets means that to the run program, it's no longer considered a terminal-type output, so generally tools that use auto-detection to decide whether or not to send colors will default to no color. If a program has a "force color" flag or similar, that should generally work with op run .....

Jack

seanboult
Mar 11, 2023 5:06 PM UTC

Just wanted to share for those here it's possible to set the environment variable FORCE_COLOR for most programs to force color output.

Not quite sure about the compatibility from program to program but it works for node based loggers 😅.

However, it seems to be working now in my contrived test somehow without --color or FORCE_COLOR 😬.

Jack_P_1P
1Password Employee
1Password Employee
Mar 13, 2023 9:06 PM UTC

Thanks for sharing @seanboult!

Jack